|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.core.subsystems.AbstractConnectorServiceManager
public abstract class AbstractConnectorServiceManager
This class is only needed if you need/want to support multiple
subsystems and want them to share a single IConnectorService
object per
connection. This is the base connector service manager implementation
that returns the same IConnectorService object for all subsystems in the
same system connection, which implement a given interface.
For this to work all your subsystem classes that wish to share the same IConnectorService object must implement a common interface of your choosing.
Another benefit of using this class or a subclass of it, is that whenever the user changes the core properties for a single subsystem (port, userId) then this manager is used to cascade that to all other subsystems in this connection which share that same common interface. This means the user can change these properties in any one subsystem, and they are changed in all related subsystems magically. This is necessary because while these properties are persisted in the subsystem object, they really belong to the IConnectorService object, so when multiple subsystems share an IConnectorService object, changes to these properties in one subsystem need to be cascaded to the other subsystems.
Because you only need a singleton of these class, the constructor is protected.
Your subclass must supply a singleton factory method like the following:
public static MyConnectorServiceManager getInstance()
{
if (inst == null)
inst = new MyConnectorServiceManager();
return inst;
}
Constructor Summary | |
---|---|
protected |
AbstractConnectorServiceManager()
Protected constructor to ensure not instantiated this way. |
Method Summary | |
---|---|
abstract IConnectorService |
createConnectorService(IHost host)
Return the actual IConnectorService object. |
protected Hashtable |
findConnHTForDummyHost(IHost newHost)
|
IConnectorService |
getConnectorService(IHost host,
Class commonSSinterface)
|
abstract Class |
getSubSystemCommonInterface(ISubSystem subsystem)
For all subsystems in a particular SystemConnection, we need to know which ones are to share a single IConnectorService object. |
void |
setConnectorService(IHost host,
Class commonSSinterface,
IConnectorService connectorService)
|
abstract boolean |
sharesSystem(ISubSystem otherSubSystem)
Given another subsystem, return true if that subsystem shares a single IConnectorService object with this one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractConnectorServiceManager()
Method Detail |
---|
public void setConnectorService(IHost host, Class commonSSinterface, IConnectorService connectorService)
setConnectorService
in interface IConnectorServiceManager
public IConnectorService getConnectorService(IHost host, Class commonSSinterface)
getConnectorService
in interface IConnectorServiceManager
protected Hashtable findConnHTForDummyHost(IHost newHost)
public abstract IConnectorService createConnectorService(IHost host)
public abstract boolean sharesSystem(ISubSystem otherSubSystem)
You can't assume a SystemConnection will only have subsystems that you created, so you should only return true if it implements your interface or you know it is an instance of your subsystem class.
This should simply return (otherSubSystem instanceof interface) where interface is the same one returned from getSubSystemCommonInterface.
public abstract Class getSubSystemCommonInterface(ISubSystem subsystem)
Whatever is returned from here is used as the key into a hashtable to find the singleton IConnectorService object in getSystemObject.
subsystem
- - rarely used, but if you support multiple common interfaces then this will help you
decide which one to return.
|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |