com.genesyslab.soa.client
Class ServiceFactory

java.lang.Object
  extended bycom.genesyslab.soa.client.ServiceFactory

public class ServiceFactory
extends java.lang.Object

Author:
foricher

Field Summary
static java.lang.String DEFAULT_CONFIGURATION_FILE
           
 
Constructor Summary
ServiceFactory()
           
 
Method Summary
static ServiceFactory asyncCreateServiceFactory(java.lang.Class serviceFactoryClass, java.util.Properties context, ServiceFactoryListener listener)
          Create a service factory in asynchronous mode.
static ServiceFactory asyncCreateServiceFactory(java.lang.String serviceFactoryName, java.util.Properties context, java.lang.String configurationFile, ServiceFactoryListener listener)
          Create a service factory regarding a configuration file in asynchronous mode.
 IService createService(java.lang.Class serviceClass, java.util.Properties context)
          Create a service
static ServiceFactory createServiceFactory(java.lang.Class serviceFactoryClass, java.util.Properties context, ServiceFactoryListener listener)
          Create a service factory.
static ServiceFactory createServiceFactory(java.lang.String serviceFactoryName, java.util.Properties context, java.lang.String configurationFile, ServiceFactoryListener listener)
          Create a service factory regarding a configuration file.
 ConnectionInfo getConnectionInfo()
          Information about the connection status.
 BaseServiceFactoryImpl getCurrentServiceFactoryImpl()
          The current real factory.
 java.lang.String[] getServices()
          Return all services classnames available in the service factory.
 void releaseFactory()
          Release the factory.
 void setCurrentServiceFactoryImpl(BaseServiceFactoryImpl currentServiceFactoryImpl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONFIGURATION_FILE

public static final java.lang.String DEFAULT_CONFIGURATION_FILE
See Also:
Constant Field Values
Constructor Detail

ServiceFactory

public ServiceFactory()
Method Detail

createServiceFactory

public static ServiceFactory createServiceFactory(java.lang.String serviceFactoryName,
                                                  java.util.Properties context,
                                                  java.lang.String configurationFile,
                                                  ServiceFactoryListener listener)
                                           throws ServiceException
Create a service factory regarding a configuration file.

Parameters:
serviceFactoryName - One of factory name defined in the configuration file.
context - Key-value pairs options.
configurationFile - Configuration file name. If null, the default file name is "proxy-configuration.xml".
listener - Factory listener
Returns:
The service Factory
Throws:
ServiceException

asyncCreateServiceFactory

public static ServiceFactory asyncCreateServiceFactory(java.lang.String serviceFactoryName,
                                                       java.util.Properties context,
                                                       java.lang.String configurationFile,
                                                       ServiceFactoryListener listener)
                                                throws ServiceException
Create a service factory regarding a configuration file in asynchronous mode.

Parameters:
serviceFactoryName - One of factory name defined in the configuration file.
context - Key-value pairs options.
configurationFile - Configuration file name. If null, the default file name is "proxy-configuration.xml".
listener - Factory listener
Returns:
The service Factory
Throws:
ServiceException

createServiceFactory

public static ServiceFactory createServiceFactory(java.lang.Class serviceFactoryClass,
                                                  java.util.Properties context,
                                                  ServiceFactoryListener listener)
                                           throws ServiceException
Create a service factory.

Parameters:
serviceFactoryClass -
context - Key-value pairs options.
listener - Factory listener
Returns:
The service Factory
Throws:
ServiceException

asyncCreateServiceFactory

public static ServiceFactory asyncCreateServiceFactory(java.lang.Class serviceFactoryClass,
                                                       java.util.Properties context,
                                                       ServiceFactoryListener listener)
                                                throws ServiceException
Create a service factory in asynchronous mode.

Parameters:
serviceFactoryClass -
context - Key-value pairs options.
listener - Factory listener
Returns:
The service Factory
Throws:
ServiceException

createService

public IService createService(java.lang.Class serviceClass,
                              java.util.Properties context)
                       throws ServiceException
Create a service

Parameters:
serviceClass -
context - Key-value pairs options.
Returns:
an instance of the service created.
Throws:
ServiceException

releaseFactory

public void releaseFactory()
                    throws ServiceException
Release the factory.

Throws:
ServiceException

getCurrentServiceFactoryImpl

public BaseServiceFactoryImpl getCurrentServiceFactoryImpl()
The current real factory.


setCurrentServiceFactoryImpl

public void setCurrentServiceFactoryImpl(BaseServiceFactoryImpl currentServiceFactoryImpl)

getConnectionInfo

public ConnectionInfo getConnectionInfo()
Information about the connection status.

Returns:
connection information.

getServices

public java.lang.String[] getServices()
                               throws ServiceException
Return all services classnames available in the service factory.

Returns:
services classnames
Throws:
ServiceException