net.sf.crispy.server
Class MultiServiceContainerImpl

java.lang.Object
  extended bynet.sf.crispy.server.MultiServiceContainerImpl

public class MultiServiceContainerImpl
extends java.lang.Object

Container for the service implementation. This is a mapping from service-interface plus a key (e.g. user key or sessionId) to the service-implementation. The service instance exist multiple (per key). They service implementation must not be Thread safe.

Since:
1.1.0
Author:
Linke

Constructor Summary
MultiServiceContainerImpl()
           
 
Method Summary
 int getKeySize()
          Size of services in the container.
 java.lang.String getRegisterServiceByServiceInterfaceName(java.lang.String pvServiceInterfaceName)
           
 int getRegisterServiceSize()
           
 java.lang.Object getService(java.lang.Object pvKey, java.lang.String pvServiceInterfaceName)
          Find the service impl.
 ServiceCreator getServiceCreator()
           
 int getServiceSize(java.lang.Object pvKey)
          Get the size of services for a key.
 void registerService(java.lang.String pvServiceInterfaceName, java.lang.String pvServiceImplName)
           
 void removeAllServices(java.lang.Object pvKey)
          Remove all service by a key.
 java.lang.String removeRegisterServiceByServiceInterfaceName(java.lang.String pvServiceInterfaceName)
           
 void removeService(java.lang.Object pvKey, java.lang.String pvServiceInterfaceName)
          Remove the service from the container.
 void setServiceCreator(ServiceCreator pvServiceCreator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiServiceContainerImpl

public MultiServiceContainerImpl()
Method Detail

setServiceCreator

public void setServiceCreator(ServiceCreator pvServiceCreator)

getServiceCreator

public ServiceCreator getServiceCreator()

registerService

public void registerService(java.lang.String pvServiceInterfaceName,
                            java.lang.String pvServiceImplName)

getRegisterServiceByServiceInterfaceName

public java.lang.String getRegisterServiceByServiceInterfaceName(java.lang.String pvServiceInterfaceName)

removeRegisterServiceByServiceInterfaceName

public java.lang.String removeRegisterServiceByServiceInterfaceName(java.lang.String pvServiceInterfaceName)

getRegisterServiceSize

public int getRegisterServiceSize()

getService

public java.lang.Object getService(java.lang.Object pvKey,
                                   java.lang.String pvServiceInterfaceName)
                            throws java.lang.Exception
Find the service impl.

Parameters:
pvKey - Is the key in a map.
pvServiceInterfaceName - Is the key for the service impl in a map.
Returns:
The service impl or null.
Throws:
java.lang.Exception

removeService

public void removeService(java.lang.Object pvKey,
                          java.lang.String pvServiceInterfaceName)
Remove the service from the container.

Parameters:
pvKey - Is the key in a map.
pvServiceInterfaceName - Is the key for the service impl in a map.

removeAllServices

public void removeAllServices(java.lang.Object pvKey)
Remove all service by a key.

Parameters:
pvKey - The key to removed services.

getServiceSize

public int getServiceSize(java.lang.Object pvKey)
Get the size of services for a key.

Parameters:
pvKey - search key
Returns:
size of services for a key

getKeySize

public int getKeySize()
Size of services in the container.

Returns:
Size of services.


Copyright © 2005-2006 Crispy. All Rights Reserved.