***  This class provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.information
Class Factory

com.sas.services.information.Factory

public class Factory

The Factory is a class that takes repository-specific objects and turns them into "smart objects". The configuration for the Factory comes from the Information Service. It consists of a mapping of protocol/type/filter to an action string. The action string will ordinarily be a constructor for a Java class. It can, however, specify to use another Platform Service to create an object, or a static method from another class.

Since:
1.0

Method Summary
 void configure(java.util.Map types)
          This is called once by the Information Service to configure the Factory class with the mappings of repository-specific types to Java classes.
static Factory getInstance()
           
 com.sas.services.information.PluginLoader getPluginLoader()
          Deprecated. Use PluginLoader.getInstance(PluginLoader.OBJECT_TYPES_LOADER) instead.
 boolean isConfigured()
          Returns true if configure() has been called, false otherwise.
 java.lang.Class loadClass(java.lang.String className)
           
 java.lang.Object newInstance(java.lang.String className)
          Create a new instance object of the specified class using the default constructor.
 java.lang.Object newInstance(java.lang.String className, java.lang.Class[] initParams, java.lang.Object[] initArgs)
          Create a new instance object of the specified class using a constructor matching the specified parameter classes.
 MetadataInterface process(java.lang.Object o)
          Deprecated. Use processWithRepository(Object, RepositoryInterface)
 MetadataInterface processWithRepository(java.lang.Object o, RepositoryInterface ri)
          Process an object from a repository and turn it into a "smart object".
 java.lang.String toString()
          Nothing interesting about this.
 

Method Detail

getInstance

public static Factory getInstance()

configure

public void configure(java.util.Map types)
This is called once by the Information Service to configure the Factory class with the mappings of repository-specific types to Java classes.

Parameters:
types - The map of factory types that determines the return from a (@link #process} call.

isConfigured

public boolean isConfigured()
Returns true if configure() has been called, false otherwise.

Returns:
true if the Factory has been configured, false otherwise.

process

public MetadataInterface process(java.lang.Object o)
                          throws ServiceException
Deprecated. Use processWithRepository(Object, RepositoryInterface)

Process an object from a repository and turn it into a "smart object". If no other action is found, the object is wrapped with a Metadata object and returned.

Parameters:
o - An object that came from a repository (Ldap, OMR, or DAV) to be wrapped in a "smart object".
Returns:
The new smart object that wraps the Object.
Throws:
ServiceException - If an error occurred in the object creation.

processWithRepository

public MetadataInterface processWithRepository(java.lang.Object o,
                                               RepositoryInterface ri)
                                        throws ServiceException
Process an object from a repository and turn it into a "smart object". If no other action is found, the object is wrapped with a Metadata object and returned.

Parameters:
o - An object that came from a repository (Ldap, OMR, or DAV) to be wrapped in a "smart object".
ri - The RepositoryInterface the data object was retrieved from or created in.
Returns:
The new smart object that wraps the Object.
Throws:
ServiceException - If an error occurred in the object creation.

loadClass

public java.lang.Class loadClass(java.lang.String className)
                          throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

toString

public java.lang.String toString()
Nothing interesting about this.

Overrides:
toString in class java.lang.Object
Returns:
an uninteresting string for this factory object.

newInstance

public java.lang.Object newInstance(java.lang.String className)
                             throws java.lang.ClassNotFoundException,
                                    ServiceException
Create a new instance object of the specified class using the default constructor.

Parameters:
className - class name of object to be instantiated
Returns:
instantiated object
Throws:
java.lang.ClassNotFoundException - Specified class not found by the plugin loader.
ServiceException - General exception wrapping other exceptions, including no default constructor, exceptions thrown by the constructor, security exceptions, etc.

newInstance

public java.lang.Object newInstance(java.lang.String className,
                                    java.lang.Class[] initParams,
                                    java.lang.Object[] initArgs)
                             throws java.lang.ClassNotFoundException,
                                    ServiceException
Create a new instance object of the specified class using a constructor matching the specified parameter classes.

Parameters:
className - class name of object to be instantiated
initParams - constructor argument signature
initArgs - arguments to be passed to the constructor.
Returns:
instantiated object
Throws:
java.lang.ClassNotFoundException - Specified class not found by the plugin loader.
ServiceException - General exception wrapping other exceptions, including no matching constructor, exceptions thrown by the constructor, security exceptions, etc.

getPluginLoader

public com.sas.services.information.PluginLoader getPluginLoader()
Deprecated. Use PluginLoader.getInstance(PluginLoader.OBJECT_TYPES_LOADER) instead.

Returns PluginLoader used by this factory.

Returns:
PluginLoader used by this factory.

***  This class provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.