public abstract class AbstractContainer extends Object implements IContainer
| Constructor and Description |
|---|
AbstractContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IContainerListener l)
Add listener to IContainer.
|
void |
dispose()
Dispose this IContainer instance.
|
protected void |
fireContainerEvent(IContainerEvent event)
Fires a container event
|
Object |
getAdapter(Class serviceType)
This specialization of IAdaptable.getAdapter() returns additional
services supported by this container.
|
protected String |
getPasswordFromConnectContext(IConnectContext connectContext) |
void |
removeListener(IContainerListener l)
Remove listener from IContainer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnect, disconnect, getConnectedID, getConnectNamespacegetIDpublic void addListener(IContainerListener l)
IContainer| container action | Event |
| connect start | IContainerConnectingEvent |
| connect complete | IContainerConnectedEvent |
| disconnect start | IContainerDisconnectingEvent |
| disconnect complete | IContainerDisconnectedEvent |
addListener in interface IContainerl - the IContainerListener to addpublic void removeListener(IContainerListener l)
IContainerremoveListener in interface IContainerl - the IContainerListener to removepublic void dispose()
IContainerdispose in interface IContainerprotected void fireContainerEvent(IContainerEvent event)
event - eventpublic Object getAdapter(Class serviceType)
IContainerIContainer
should 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.
getAdapter in interface org.eclipse.core.runtime.IAdaptablegetAdapter in interface IContainerserviceType - the service type to look upnull if this container does not support the given
serviceprotected String getPasswordFromConnectContext(IConnectContext connectContext) throws ContainerConnectException
ContainerConnectExceptionCopyright © 2004–2020 Eclipse Foundation. All rights reserved.