All Implemented Interfaces:
Direct Known Subclasses:
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();
Methods inherited from class java.lang.
- Protected constructor to ensure not instantiated this way.
Use subclass-supplied static singleton factory method getInstance() instead.
public void setConnectorService(
- Return the actual IConnectorService object. Must be overridden by subclass.
public abstract boolean sharesSystem(
- Given another subsystem, return true if that subsystem shares a single IConnectorService object
with this one. You must override this to return true if you recognize that subsystem
as one of your own. You are guaranteed the other subsystem will be from the same
SystemConnection as this one.
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.
- For all subsystems in a particular SystemConnection, we need to know which
ones are to share a single IConnectorService object. To do this, we need a key which
is canonical for all subsystems in a given connection. This can be anything,
but is typically a unique interface that all subsystems supported a shared
IConnectorService object implement.
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.
- a common, yet unique to you, interface that all your subsystems implement.
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.