|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.subsystems.impl.AbstractSystemManager
This class is only needed if you need/want to support multiple
subsystems and want them to share a single ISystem
object per
system connection. This is the base system manager implementation
that returns the same ISystem 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 ISystem 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 ISystem object, so when multiple subsystems share an ISystem 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 method like the following:
public static AbstractSystemManager getTheSystemManager()
{
if (inst == null)
inst = new AbstractSystemManager();
return inst;
}
Your SubSystem
class
should then call this factory method in its getSystemManager()
method.
Field Summary | |
---|---|
static String |
Copyright
|
Constructor Summary | |
---|---|
protected |
AbstractSystemManager()
Protected constructor to ensure not instantiated this way. |
Method Summary | |
---|---|
abstract ISystem |
createSystemObject(SubSystem subsystem)
Return the actual ISystem object. |
abstract Class |
getSubSystemCommonInterface(SubSystem subsystem)
For all subsystems in a particular SystemConnection, we need to know which ones are to share a single ISystem object. |
ISystem |
getSystemObject(SubSystem subsystem)
Fully implemented, no need to override. |
abstract boolean |
sharesSystem(SubSystem otherSubSystem)
Given another subsystem, return true if that subsystem shares a single ISystem object with this one. |
void |
updateSubSystems(Shell shell,
SubSystem subsystem,
boolean updateUserId,
String userId,
boolean updatePort,
Integer port)
Internal use. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String Copyright
Constructor Detail |
protected AbstractSystemManager()
Method Detail |
public ISystem getSystemObject(SubSystem subsystem)
ISystem
object for the given subsystem.
Keys off the subsystem's connection to return the singleton
system object per unique connection. If one has been created for this connection
already, we return it. Else, we first test if the given subsystem's subsystem factory
has a registered ISystem class, registered via the systemClass extension point attribute
for the subsystemfactory extension point. If so, we call ISubSystemFactoryProxy.getSystemObject()
to return an instance of that class. If not, then we call createSystemObject(SubSystem)
to
get an instance, and this method is implemented by subclasses.
public abstract ISystem createSystemObject(SubSystem subsystem)
public abstract boolean sharesSystem(SubSystem 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(SubSystem subsystem)
Whatever is returned from here is used as the key into a hashtable to find the singleton ISystem object in getSystemObject.
subsystem
- - rarely used, but if you support multiple common interfaces then this will help you
decide which one to return.
public void updateSubSystems(Shell shell, SubSystem subsystem, boolean updateUserId, String userId, boolean updatePort, Integer port)
SubSystemFactoryImpl.updateSubSystem(Shell,SubSystem,boolean,String,boolean,Integer)
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |