Class JSLPDiscoveryContainer
- java.lang.Object
- 
- org.eclipse.ecf.core.AbstractContainer
- 
- org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
- 
- org.eclipse.ecf.provider.jslp.container.JSLPDiscoveryContainer
 
 
 
- 
- All Implemented Interfaces:
- org.eclipse.core.runtime.IAdaptable,- IContainer,- IIdentifiable,- IDiscoveryAdvertiser,- IDiscoveryContainerAdapter,- IDiscoveryLocator,- IDiscoveryService
 
 public class JSLPDiscoveryContainer extends AbstractDiscoveryContainerAdapter implements IDiscoveryService 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringNAMEstatic longREDISCOVER- 
Fields inherited from class org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapterallServiceListeners, serviceListeners, servicesNamespaceName, serviceTypeListeners
 - 
Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryAdvertiserCONTAINER_NAME
 - 
Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryLocatorCONTAINER_NAME
 - 
Fields inherited from interface org.eclipse.ecf.discovery.service.IDiscoveryServiceCONTAINER_ID, CONTAINER_NAME
 
- 
 - 
Constructor SummaryConstructors Constructor Description JSLPDiscoveryContainer()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddServiceListener(IServiceTypeID type, IServiceListener listener)Add a service listener.voidaddServiceListener(IServiceListener listener)Add a service listener.voidaddServiceTypeListener(IServiceTypeListener listener)Add a service type listener.voidconnect(ID aTargetID, IConnectContext connectContext)Connect to a target remote process or process group.voiddisconnect()Disconnect.voidfireServiceDiscovered(IServiceInfo iinfo)voidfireServiceTypeDiscovered(IServiceTypeID serviceTypeID)voidfireServiceUndiscovered(IServiceInfo iinfo)IDgetConnectedID()Get the target ID that this container instance has connected to.StringgetContainerName()IServiceInfogetServiceInfo(IServiceID service)Synchronously retrieve info about the serviceIServiceInfo[]getServices()Synchronously get service info about all known servicesIServiceInfo[]getServices(IServiceTypeID type)Synchronously get service info about all known services of given service typeIServiceTypeID[]getServiceTypes()Synchronously get service info about all known services of given service typeIServiceInfo[]purgeCache()Purges the underlying IServiceInfo cache if available in the current providervoidregisterService(IServiceInfo aServiceInfo)Register the given service.voidunregisterService(IServiceInfo aServiceInfo)Unregister a previously registered service defined by serviceInfo.- 
Methods inherited from class org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapterclearListeners, dispose, fireServiceDiscovered, fireServiceTypeDiscovered, fireServiceUndiscovered, getAsyncServiceInfo, getAsyncServices, getAsyncServices, getAsyncServiceTypes, getConfig, getConnectNamespace, getID, getListeners, getServiceEvent, getServicesNamespace, removeServiceListener, removeServiceListener, removeServiceTypeListener, unregisterAllServices
 - 
Methods inherited from class org.eclipse.ecf.core.AbstractContaineraddListener, fireContainerEvent, getAdapter, getPasswordFromConnectContext, removeListener
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.eclipse.ecf.discovery.IDiscoveryAdvertisergetServicesNamespace, unregisterAllServices
 - 
Methods inherited from interface org.eclipse.ecf.discovery.IDiscoveryLocatorgetAsyncServiceInfo, getAsyncServices, getAsyncServices, getAsyncServiceTypes, getServicesNamespace, removeServiceListener, removeServiceListener, removeServiceTypeListener
 
- 
 
- 
- 
- 
Field Detail- 
NAMEpublic static final String NAME - See Also:
- Constant Field Values
 
 - 
REDISCOVERpublic static long REDISCOVER 
 
- 
 - 
Method Detail- 
connectpublic void connect(ID aTargetID, IConnectContext connectContext) throws ContainerConnectException Description copied from interface:IContainerConnect to a target remote process or process group. The target identified by the first parameter (targetID) is connected the implementation class. If authentication information is required, the required information is given via via the second parameter (connectContext). Callers note that depending upon the provider implementation this method may block. It is suggested that callers use a separate thread to call this method. This method provides an implementation independent way for container implementations to connect, authenticate, and communicate with a remote service or group of services. Providers are responsible for implementing this operation in a way appropriate to the given remote service (or group) via expected protocol.- Specified by:
- connectin interface- IContainer
- Parameters:
- aTargetID- the ID of the remote server or group to connect to. See- IContainer.getConnectNamespace()for a explanation of the constraints upon this parameter.
- connectContext- any required context to allow this container to authenticate. May be- nullif underlying provider does not have any authentication requirements for connection.
- Throws:
- ContainerConnectException- thrown if communication cannot be established with remote service. Causes can include network connection failure, authentication failure, server error, or if container is already connected.
 
 - 
disconnectpublic void disconnect() Description copied from interface:IContainerDisconnect. This operation will disconnect the local container instance from any previously joined target or group. Subsequent calls to getConnectedID() will returnnull.- Specified by:
- disconnectin interface- IContainer
 
 - 
fireServiceDiscoveredpublic void fireServiceDiscovered(IServiceInfo iinfo) 
 - 
fireServiceTypeDiscoveredpublic void fireServiceTypeDiscovered(IServiceTypeID serviceTypeID) 
 - 
fireServiceUndiscoveredpublic void fireServiceUndiscovered(IServiceInfo iinfo) 
 - 
getConnectedIDpublic ID getConnectedID() Description copied from interface:IContainerGet the target ID that this container instance has connected to. Returns null if not connected.- Specified by:
- getConnectedIDin interface- IContainer
- Returns:
- ID of the target we are connected to. Returns nullif container not connected.
 
 - 
getServiceInfopublic IServiceInfo getServiceInfo(IServiceID service) Description copied from interface:IDiscoveryLocatorSynchronously retrieve info about the service- Specified by:
- getServiceInfoin interface- IDiscoveryLocator
- Parameters:
- service- IServiceID of the service to get info about. Must not be- null.
- Returns:
- IServiceInfo the service info retrieved. nullif no information retrievable.
 
 - 
getServiceTypespublic IServiceTypeID[] getServiceTypes() Description copied from interface:IDiscoveryLocatorSynchronously get service info about all known services of given service type- Specified by:
- getServiceTypesin interface- IDiscoveryLocator
- Returns:
- IServiceTypeID[] the resulting array of service type IDs. Will
         not be null. May be of length 0.
 
 - 
getServicespublic IServiceInfo[] getServices() Description copied from interface:IDiscoveryLocatorSynchronously get service info about all known services- Specified by:
- getServicesin interface- IDiscoveryLocator
- Returns:
- IServiceInfo[] the resulting array of service info instances.
         Will not be null. May be of length 0.
 
 - 
getServicespublic IServiceInfo[] getServices(IServiceTypeID type) Description copied from interface:IDiscoveryLocatorSynchronously get service info about all known services of given service type- Specified by:
- getServicesin interface- IDiscoveryLocator
- Parameters:
- type- IServiceTypeID defining the type of service we are interested in getting service info about. Must not be- null
- Returns:
- IServiceInfo[] the resulting array of service info instances.
         Will not be null. May be of length 0.
 
 - 
registerServicepublic void registerService(IServiceInfo aServiceInfo) Description copied from interface:IDiscoveryAdvertiserRegister the given service. This publishes the service defined by the serviceInfo to the underlying publishing mechanism- Specified by:
- registerServicein interface- IDiscoveryAdvertiser
- Parameters:
- aServiceInfo- IServiceInfo of the service to be published. Must not be- null.
 
 - 
unregisterServicepublic void unregisterService(IServiceInfo aServiceInfo) Description copied from interface:IDiscoveryAdvertiserUnregister a previously registered service defined by serviceInfo.- Specified by:
- unregisterServicein interface- IDiscoveryAdvertiser
- Parameters:
- aServiceInfo- IServiceInfo defining the service to unregister. Must not be- null.
 
 - 
purgeCachepublic IServiceInfo[] purgeCache() Description copied from interface:IDiscoveryLocatorPurges the underlying IServiceInfo cache if available in the current provider- Specified by:
- purgeCachein interface- IDiscoveryLocator
- Overrides:
- purgeCachein class- AbstractDiscoveryContainerAdapter
- Returns:
- The previous cache content
- See Also:
- IDiscoveryLocator.purgeCache()
 
 - 
addServiceListenerpublic void addServiceListener(IServiceListener listener) Description copied from interface:IDiscoveryLocatorAdd a service listener. The given listener will have its method called when a service is discovered.- Specified by:
- addServiceListenerin interface- IDiscoveryLocator
- Overrides:
- addServiceListenerin class- AbstractDiscoveryContainerAdapter
- Parameters:
- listener- IServiceListener to be notified. Must not be- null.
 
 - 
addServiceListenerpublic void addServiceListener(IServiceTypeID type, IServiceListener listener) Description copied from interface:IDiscoveryLocatorAdd a service listener. The given listener will have its method called when a service with a type matching that specified by the first parameter is discovered.- Specified by:
- addServiceListenerin interface- IDiscoveryLocator
- Overrides:
- addServiceListenerin class- AbstractDiscoveryContainerAdapter
- Parameters:
- type- String type to listen for. Must not be- null. Must be formatted according to this specific IDiscoveryContainer
- listener- IServiceListener to be notified. Must not be- null.
 
 - 
addServiceTypeListenerpublic void addServiceTypeListener(IServiceTypeListener listener) Description copied from interface:IDiscoveryLocatorAdd a service type listener. The given listener will have its method called when a service type is discovered.- Specified by:
- addServiceTypeListenerin interface- IDiscoveryLocator
- Overrides:
- addServiceTypeListenerin class- AbstractDiscoveryContainerAdapter
- Parameters:
- listener- the listener to be notified. Must not be- null.
 
 - 
getContainerNamepublic String getContainerName() - Specified by:
- getContainerNamein class- AbstractDiscoveryContainerAdapter
- Returns:
- The name of this discovery container
 
 
- 
 
-