- Direct Known Subclasses:
public abstract class AbstractContainer extends Object implements IContainerAbstract implementation of IContainer. Provides implementations of listener methods that subsclasses may use to avoid having to implement them themselves. This class may be subclassed as needed.
Constructors Constructor Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
addListener(IContainerListener l)Add listener to IContainer.
dispose()Dispose this IContainer instance.
fireContainerEvent(IContainerEvent event)Fires a container event
getAdapter(Class<T> serviceType)This specialization of IAdaptable.getAdapter() returns additional services supported by this container.
removeListener(IContainerListener l)Remove listener from IContainer.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.ecf.core.IContainer
connect, disconnect, getConnectedID, getConnectNamespace
public void addListener(IContainerListener l)Add listener to IContainer. The listener's handleEvent method will be synchronously called when container methods are called. Minimally, the events delivered to the listener are as follows
Container Events container action Event connect start IContainerConnectingEvent connect complete IContainerConnectedEvent disconnect start IContainerDisconnectingEvent disconnect complete IContainerDisconnectedEvent
public void removeListener(IContainerListener l)Remove listener from IContainer.
public void dispose()Dispose this IContainer instance. The container instance will be made inactive after the completion of this method and will be unavailable for subsequent usage.
protected void fireContainerEvent(IContainerEvent event)Fires a container event
public <T> T getAdapter(Class<T> serviceType)This specialization of IAdaptable.getAdapter() returns additional services supported by this container. A container that supports additional services over and above the methods on
IContainershould return them using this method. It is recommended that clients use this method rather than instanceof checks and downcasts to find out about the capabilities of a specific container.
Typically, after obtaining an IContainer, a client would use this method as a means to obtain a more meaningful interface to the container. This interface may or may not extend IContainer. For example, a client could use the following code to obtain an instance of ISharedObjectContainer:
IContainer newContainer = ContainerFactory.createContainer(type); ISharedObjectContainer soContainer = (ISharedObjectContainer) newContainer .getAdapter(ISharedObjectContainer.class); if (soContainer == null) throw new ContainerCreateException(message);
Implementations of this method should delegate to
IAdapterManager.loadAdapter()if the service cannot be provided directly to ensure extensibility by third-party plug-ins.