org.objectweb.jonas.security.realm.factory
Class JResourceFactory

java.lang.Object
  extended byorg.objectweb.jonas.security.realm.factory.JResourceFactory
All Implemented Interfaces:
javax.naming.spi.ObjectFactory
Direct Known Subclasses:
JResourceDSFactory, JResourceLDAPFactory, JResourceMemoryFactory

public abstract class JResourceFactory
extends java.lang.Object
implements javax.naming.spi.ObjectFactory

This class provides an implementation of the abstract JResource factory for managing users

Author:
Florent Benoit

Field Summary
protected static org.objectweb.util.monolog.api.Logger logger
          The logger used in JOnAS
 
Constructor Summary
JResourceFactory()
           
 
Method Summary
protected  java.lang.Object getArrayFromBytes(byte[] bytes)
          Return an object from an array of bytes.
abstract  java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable environment)
          Creates a object using the location or reference information specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.objectweb.util.monolog.api.Logger logger
The logger used in JOnAS

Constructor Detail

JResourceFactory

public JResourceFactory()
Method Detail

getObjectInstance

public abstract java.lang.Object getObjectInstance(java.lang.Object obj,
                                                   javax.naming.Name name,
                                                   javax.naming.Context nameCtx,
                                                   java.util.Hashtable environment)
                                            throws java.lang.Exception
Creates a object using the location or reference information specified.

Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory
Parameters:
obj - the possibly null object containing location or reference information that can be used in creating an object.
name - the name of this object relative to nameCtx, or null if no name is specified.
nameCtx - the context relative to which the name parameter is specified, or null if name is relative to the default initial context.
environment - the possibly null environment that is used in creating the object.
Returns:
a newly created object with the specific configuration; null if an object cannot be created.
Throws:
java.lang.Exception - if this object factory encountered an exception while attempting to create an object, and no other object factories are to be tried.

getArrayFromBytes

protected java.lang.Object getArrayFromBytes(byte[] bytes)
Return an object from an array of bytes. Useful for BinaryRefAddr

Parameters:
bytes - an array of bytes
Returns:
an object or null if there is an error of if it's empty