RSE
Release 3.4

org.eclipse.rse.connectorservice.dstore
Class DStoreConnectorServiceManager

java.lang.Object
  extended by org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager
      extended by org.eclipse.rse.connectorservice.dstore.DStoreConnectorServiceManager
All Implemented Interfaces:
IConnectorServiceManager

public class DStoreConnectorServiceManager
extends AbstractConnectorServiceManager

IConnectorService manager class. There should be only one of these instantiated. Use getInstance() to get that singleton.

The job of this manager is to manage and return IConnectorService objects. It ensures there is only ever one per unique SystemConnection, so that both the file and command subsystems can share the same system object.


Method Summary
 IConnectorService createConnectorService(IHost host)
          Return the actual IConnectorService object.
static DStoreConnectorServiceManager getInstance()
          Return singleton instance of this class
 Class getSubSystemCommonInterface(ISubSystem subsystem)
          For all subsystems in a particular SystemConnection, we need to know which ones are to share a single IConnectorService object.
static boolean isInstantiated()
          Return true if the singleton has been created.
 boolean sharesSystem(ISubSystem otherSubSystem)
          Given another subsystem, return true if that subsystem shares a single IConnectorService object with this one.
 
Methods inherited from class org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager
findConnHTForDummyHost, getConnectorService, setConnectorService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DStoreConnectorServiceManager getInstance()
Return singleton instance of this class


isInstantiated

public static boolean isInstantiated()
Return true if the singleton has been created. This saves creating it at shutdown just to test for isConnected.


createConnectorService

public IConnectorService createConnectorService(IHost host)
Return the actual IConnectorService object. We return an instance of UniversalSystem.

Specified by:
createConnectorService in class AbstractConnectorServiceManager

getSubSystemCommonInterface

public Class getSubSystemCommonInterface(ISubSystem subsystem)
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.

Specified by:
getSubSystemCommonInterface in class AbstractConnectorServiceManager
Parameters:
subsystem - - rarely used, but if you support multiple common interfaces then this will help you decide which one to return.
Returns:
IUniversalSubSystem.class

sharesSystem

public boolean sharesSystem(ISubSystem otherSubSystem)
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 you only have subsystems of 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

Specified by:
sharesSystem in class AbstractConnectorServiceManager
Returns:
true if otherSubSystem instanceof IUniversalSubSystem

RSE
Release 3.4

Copyright (c) IBM Corporation and others 2000, 2012. All Rights Reserved.