Remote Systems
v6.4.1

com.ibm.etools.systems.subsystems.impl
Class AbstractSystemManager

java.lang.Object
  extended bycom.ibm.etools.systems.subsystems.impl.AbstractSystemManager
Direct Known Subclasses:
LocalSystemManager, UniversalSystemManager

public abstract class AbstractSystemManager
extends Object

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

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

AbstractSystemManager

protected AbstractSystemManager()
Protected constructor to ensure not instantiated this way. Use subclass-supplied static method getTheSystemFactory() instead.

Method Detail

getSystemObject

public ISystem getSystemObject(SubSystem subsystem)
Fully implemented, no need to override.
Return an 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.


createSystemObject

public abstract ISystem createSystemObject(SubSystem subsystem)
Return the actual ISystem object. Must be overridden by subclass.


sharesSystem

public abstract boolean sharesSystem(SubSystem otherSubSystem)
Given another subsystem, return true if that subsystem shares a single ISystem 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.


getSubSystemCommonInterface

public 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. 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 ISystem object implement.

Whatever is returned from here is used as the key into a hashtable to find the singleton ISystem object in getSystemObject.

Parameters:
subsystem - - rarely used, but if you support multiple common interfaces then this will help you decide which one to return.
Returns:
a common, yet unique to you, interface that all your subsystems implement.

updateSubSystems

public void updateSubSystems(Shell shell,
                             SubSystem subsystem,
                             boolean updateUserId,
                             String userId,
                             boolean updatePort,
                             Integer port)
Internal use. Fully implemented, no need to override.
Updates user-editable attributes of an existing subsystem instance. The goal of this method is to intercept the request and forward it on to all our subsystems in this SystemConnection, that share a single ISystem, so we keep them all in synch in terms of these two properties used by all ISystems.

See Also:
SubSystemFactoryImpl.updateSubSystem(Shell,SubSystem,boolean,String,boolean,Integer)

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.