Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.net
Class WrapperService

java.lang.Object
  extended by com.tangosol.net.WrapperService

All Implemented Interfaces:
ClassLoaderAware, Controllable, Service
Direct Known Subclasses:
WrapperCacheService, WrapperInvocationService

public class WrapperService
extends java.lang.Object
implements Service

Service implementation that delegates to a wrapped Service instance.

Author:
jh 2010.03.17

Field Summary
protected  Service m_service
          The (wrapped) Service.

 

Constructor Summary
WrapperService(Service service)
          Create a new WrapperService that delegates to the given Service instance.

 

Method Summary
 void addMemberListener(MemberListener listener)
          Add a Member listener.
 void addServiceListener(ServiceListener listener)
          Register a ServiceListener that will receive events pertaining to the lifecycle of this Service.
 void configure(XmlElement xml)
          Configure the controllable service.
 Cluster getCluster()
          Return the Cluster object that this Service is a part of.
 java.lang.ClassLoader getContextClassLoader()
          Retrieve the context ClassLoader for this object.
 ServiceInfo getInfo()
          Return the ServiceInfo object for this Service.
 Serializer getSerializer()
          Return a Serializer used by this Service.
 Service getService()
          Return the wrapped Service.
 java.lang.Object getUserContext()
          Return the user context object associated with this Service.
 boolean isRunning()
          Determine whether or not the controllable service is running.
 void removeMemberListener(MemberListener listener)
          Remove a Member listener.
 void removeServiceListener(ServiceListener listener)
          Unregister a ServiceListener from this ConnectionManager.
 void setContextClassLoader(java.lang.ClassLoader loader)
          Specify the context ClassLoader for this object.
 void setUserContext(java.lang.Object oCtx)
          Associate a user context object with this Service.
 void shutdown()
          Stop the controllable service.
 void start()
          Start the controllable service.
 void stop()
          Hard-stop the controllable service.
 java.lang.String toString()
          

 

Field Detail

m_service

protected Service m_service
The (wrapped) Service.

Constructor Detail

WrapperService

public WrapperService(Service service)
Create a new WrapperService that delegates to the given Service instance.
Parameters:
service - the Service to wrap

Method Detail

getCluster

public Cluster getCluster()
Return the Cluster object that this Service is a part of.
Returns:
the Cluster object

getInfo

public ServiceInfo getInfo()
Return the ServiceInfo object for this Service.
Returns:
the ServiceInfo object

addMemberListener

public void addMemberListener(MemberListener listener)
Add a Member listener.
Parameters:
listener - the MemberListener to add

removeMemberListener

public void removeMemberListener(MemberListener listener)
Remove a Member listener.
Parameters:
listener - the MemberListener to remove

getUserContext

public java.lang.Object getUserContext()
Return the user context object associated with this Service.

The data type and semantics of this context object are entirely application specific and are opaque to the Service itself.

Returns:
an associated user context object or null if a context has not been set

setUserContext

public void setUserContext(java.lang.Object oCtx)
Associate a user context object with this Service.
Parameters:
oCtx - a user context object

getSerializer

public Serializer getSerializer()
Return a Serializer used by this Service.
Returns:
the Serializer object

addServiceListener

public void addServiceListener(ServiceListener listener)
Register a ServiceListener that will receive events pertaining to the lifecycle of this Service.
Specified by:
addServiceListener in interface Service
Parameters:
listener - the new ServiceListener to register; if the listener has already been registered, this method has no effect

removeServiceListener

public void removeServiceListener(ServiceListener listener)
Unregister a ServiceListener from this ConnectionManager.

After a ServiceListener is removed, it will no longer receive events pertaining to the lifecycle of this Service.

Specified by:
removeServiceListener in interface Service
Parameters:
listener - the ServiceListener to deregister; if the listener has not previously been registered, this method has no effect

configure

public void configure(XmlElement xml)
Configure the controllable service.

This method can only be called before the controllable service is started.

Specified by:
configure in interface Controllable
Parameters:
xml - an XmlElement carrying configuration information specific to the Controllable object

start

public void start()
Start the controllable service.

This method should only be called once per the life cycle of the Controllable service. This method has no affect if the service is already running.

Specified by:
start in interface Controllable

isRunning

public boolean isRunning()
Determine whether or not the controllable service is running. This method returns false before a service is started, while the service is starting, while a service is shutting down and after the service has stopped. It only returns true after completing its start processing and before beginning its shutdown processing.
Specified by:
isRunning in interface Controllable
Returns:
true if the service is running; false otherwise

shutdown

public void shutdown()
Stop the controllable service. This is a controlled shut-down, and is preferred to the Controllable.stop() method.

This method should only be called once per the life cycle of the controllable service. Calling this method for a service that has already stopped has no effect.

Specified by:
shutdown in interface Controllable

stop

public void stop()
Hard-stop the controllable service. Use Controllable.shutdown() for normal service termination. Calling this method for a service that has already stopped has no effect.
Specified by:
stop in interface Controllable

getContextClassLoader

public java.lang.ClassLoader getContextClassLoader()
Retrieve the context ClassLoader for this object. The context ClassLoader is provided by the creator of the object for use by the object when loading classes and resources.
Specified by:
getContextClassLoader in interface ClassLoaderAware
Returns:
the context ClassLoader for this object
See Also:
Thread.getContextClassLoader()

setContextClassLoader

public void setContextClassLoader(java.lang.ClassLoader loader)
Specify the context ClassLoader for this object. The context ClassLoader can be set when the object is created, and allows the creator to provide the appropriate class loader to be used by the object when when loading classes and resources.
Specified by:
setContextClassLoader in interface ClassLoaderAware
Parameters:
loader - the context ClassLoader for this object

toString

public java.lang.String toString()

getService

public Service getService()
Return the wrapped Service.
Returns:
the wrapped Service

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.