net.jini.lookup
Class JoinManager.ProxyReg

java.lang.Object
  extended by net.jini.lookup.JoinManager.ProxyReg
Enclosing class:
JoinManager

private class JoinManager.ProxyReg
extends Object

Wrapper class in which each instance corresponds to a lookup service to discover, and with which this join manager's service should be registered.


Nested Class Summary
private  class JoinManager.ProxyReg.DiscLeaseListener
          Class that is registered as a listener with this join manager's lease renewal manager.
 
Field Summary
private  JoinManager.ProxyReg.DiscLeaseListener dListener
          The instance of DiscLeaseListener that is registered with the lease renewal manager that handles the lease of this join manger's service.
 ServiceRegistrar proxy
          The prepared proxy to the lookup service referenced by this class, and with which this join manager's service will be registered.
 JoinManager.ProxyRegTask proxyRegTask
          The ProxyRegTask that instantiated this ProxyReg.
 Lease serviceLease
           
 ServiceRegistration srvcRegistration
          The prepared registration proxy returned by this class' associated lookup service when this join manager registers its associated service.
 List taskList
          The set of sub-tasks that are to be executed in order for the lookup service associated with the current instance of this class.
 
Constructor Summary
JoinManager.ProxyReg(ServiceRegistrar proxy)
          Constructor that associates this class with the lookup service referenced in the given ProxyReg parameter.
 
Method Summary
 void addAttributes(Entry[] attSet)
          With respect to the lookup service referenced in this class and with which this join manager's service is registered, this method associates with that service a new set of attributes -- in addition to that service's current set of attributes.
 void addTask(JoinManager.JoinTask task)
          Convenience method that adds new sub-tasks to this class' task queue.
 boolean equals(Object obj)
          Returns true if the both objects' associated proxies are equal.
 void fail(Throwable e)
          Convenience method that encapsulates appropriate behavior when failure is encountered related to the current instance of this class.
 int hashCode()
          Returns the hash code of the proxy referenced in this class.
 void modifyAttributes(Entry[] templ, Entry[] attSet)
          With respect to the lookup service referenced in this class and with which this join manager's service is registered, this method changes that service's current attributes by selecting the attributes to change using the given first parameter; and identifying the desired changes to make through the contents of the second parameter.
 void register(Entry[] srvcAttrs)
          Registers the service associated with this join manager with the the lookup service corresponding to this class.
 void setAttributes(Entry[] attSet)
          With respect to the lookup service referenced in this class and with which this join manager's service is registered, this method replaces that service's current attributes with a new set of attributes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proxyRegTask

public JoinManager.ProxyRegTask proxyRegTask
The ProxyRegTask that instantiated this ProxyReg.


proxy

public ServiceRegistrar proxy
The prepared proxy to the lookup service referenced by this class, and with which this join manager's service will be registered.


srvcRegistration

public ServiceRegistration srvcRegistration
The prepared registration proxy returned by this class' associated lookup service when this join manager registers its associated service.


serviceLease

public Lease serviceLease

taskList

public List taskList
The set of sub-tasks that are to be executed in order for the lookup service associated with the current instance of this class.


dListener

private JoinManager.ProxyReg.DiscLeaseListener dListener
The instance of DiscLeaseListener that is registered with the lease renewal manager that handles the lease of this join manger's service.

Constructor Detail

JoinManager.ProxyReg

public JoinManager.ProxyReg(ServiceRegistrar proxy)
Constructor that associates this class with the lookup service referenced in the given ProxyReg parameter.

Parameters:
proxy - data structure that references the lookup service on which the sub-tasks referenced in this class will be executed in order
Method Detail

addTask

public void addTask(JoinManager.JoinTask task)
Convenience method that adds new sub-tasks to this class' task queue.

Parameters:
task - the task to add to the task queue

register

public void register(Entry[] srvcAttrs)
              throws Exception
Registers the service associated with this join manager with the the lookup service corresponding to this class. Additionally, this method retrieves the lease granted by the lookup service on the service's registration, and passes that lease to the lease renewal manager. If a ServiceIDListener has been registered with this join manager, this method will send to that listener a notification containing the service's ID.

Throws:
Exception

addAttributes

public void addAttributes(Entry[] attSet)
                   throws Exception
With respect to the lookup service referenced in this class and with which this join manager's service is registered, this method associates with that service a new set of attributes -- in addition to that service's current set of attributes.

Throws:
Exception

modifyAttributes

public void modifyAttributes(Entry[] templ,
                             Entry[] attSet)
                      throws Exception
With respect to the lookup service referenced in this class and with which this join manager's service is registered, this method changes that service's current attributes by selecting the attributes to change using the given first parameter; and identifying the desired changes to make through the contents of the second parameter.

Throws:
Exception

setAttributes

public void setAttributes(Entry[] attSet)
                   throws Exception
With respect to the lookup service referenced in this class and with which this join manager's service is registered, this method replaces that service's current attributes with a new set of attributes.

Throws:
Exception

fail

public void fail(Throwable e)
Convenience method that encapsulates appropriate behavior when failure is encountered related to the current instance of this class. This method discards the lookup service proxy associated with this object, and logs the stack trace of the given Throwable according to the logging levels specified for this utility. Note that if the discovery manager employed by this join manager has been terminated, then the attempt to discard the lookup service proxy will result in an IllegalStateException. Since this method is called only within the tasks run by this join manager, and since propagating an IllegalStateException out into the ThreadGroup of those tasks is undesirable, this method will not propagate the IllegalStateException that occurs as a result of an attempt to discard a lookup service proxy from the discovery manager employed by this join manager. For more information, refer to Bug 4490355.


equals

public boolean equals(Object obj)
Returns true if the both objects' associated proxies are equal.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns the hash code of the proxy referenced in this class.

Overrides:
hashCode in class Object


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.