***  This API provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.deployment
Class RMIBinding

java.lang.Object
  |
  +--com.sas.services.deployment.RMIBinding
All Implemented Interfaces:
DeployInterface,

public class RMIBinding
extends Object
implements DeployInterface, java.io.Serializable

RMI binding that associates an RMI remote/activatable object with a name bound to an rmiregistry. The rmiregistry information is specified by the associated RMIConfiguration.

Since:
1.0
See Also:
RMIConfiguration, Serialized Form

Field Summary
static String LOCALHOST
          String constant denoting the local host.
static short RMI_BINDING_BIND
          RMI binding: bind remote to the rmiregistry
static short RMI_BINDING_INVALID
          RMI binding: unitialized
static short RMI_BINDING_LOOKUP
          RMI binding: lookup remote in the rmiregistry
static short RMI_BINDING_REBIND
          RMI binding: rebind remote to the rmiregistry
 
Constructor Summary
RMIBinding(RMIConfiguration rmiConfiguration, String bindName, short binding)
          Constructor specifying the RMI configuration and the bind name for the RMI remote/activatable object.
 
Method Summary
 RemoteServiceInterface deploy()
          Deploys the class in-process (within the same JVM).
 ActivatableWrapper getActivatable()
          Gets a wrapper class encapsulating an RMI activatable object.
static short getBinding(String bindingType)
          Translates a string value representing the binding to a short.
 String getBindName()
          Gets the name by which the remote/activatable object is to be bound to the rmiregistry.
 Remote getRemoteObject()
          Gets the remote object.
 RMIConfiguration getRMIConfiguration()
          Gets the RMI configuration, host and port, for this binding.
 String getUrl()
          Gets the URL used to access the RMI service via its bind name at the using the RMI configuration.
 boolean isActivatable()
          Determines whether or not this binding contains an RMI activatable object.
 boolean isBind()
          Determines whether or not the remote is associated with an RMI registry via a "bind".
 boolean isNamingLookup()
          Determines whether or not a naming lookup should be done to obtain a remote object..
 boolean isRebind()
          Gets the preference to rebind or bind when associating a remote with an rmiregistry.
 boolean isRegisterWithRMI()
          Gets the preference to bind or not to bind a remote object to the rmiregistry.
 void setActivatable(ActivatableWrapper activatableWrapper)
          Sets the activatable.
 void setBinding(short bindingType)
          Sets the RMI binding type.
 void setBindName(String bindName)
          Sets the name to be bound to the rmiregistry.
 void setRegisterWithRMI(boolean registerWithRMI)
          Specifies whether or not to bind the remote object to the rmiregistry.
 void setRemoteObject(Remote remoteObject)
          Sets the remote object to be bound to the rmiregistry.
 void setRMIConfiguration(RMIConfiguration rmiConfiguration)
          Sets the RMI configuration that describes the host and port.
 String toString()
          Gets a string representation of this instance.
 void unbind()
          Unbinds the name binding from the RMI registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALHOST

public static final String LOCALHOST
String constant denoting the local host.

RMI_BINDING_INVALID

public static final short RMI_BINDING_INVALID
RMI binding: unitialized

RMI_BINDING_BIND

public static final short RMI_BINDING_BIND
RMI binding: bind remote to the rmiregistry

RMI_BINDING_REBIND

public static final short RMI_BINDING_REBIND
RMI binding: rebind remote to the rmiregistry

RMI_BINDING_LOOKUP

public static final short RMI_BINDING_LOOKUP
RMI binding: lookup remote in the rmiregistry
Constructor Detail

RMIBinding

public RMIBinding(RMIConfiguration rmiConfiguration,
                  String bindName,
                  short binding)
           throws ServiceException
Constructor specifying the RMI configuration and the bind name for the RMI remote/activatable object.
Parameters:
rmiConfiguration - RMI configuration in terms of the host and port.
bindName - Name by which the RMI remote/activatable object is to be bound to the rmiregistry.
binding - RMI binding. One of
  • RMI_BINDING_BIND
  • RMI_BINDING_REBIND
  • RMI_BINDING_LOOKUP
Throws:
ServiceException - if unable to construct an RMI binding.
Method Detail

getBinding

public static final short getBinding(String bindingType)
Translates a string value representing the binding to a short.
Parameters:
bindingType - RMI binding type which should be one of: "RMI_REBIND", "RMI_BIND" or "RMI_LOOKUP".
Returns:
Code representing the RMI binding or RMIBinding.RMI_BINDING_INVALID if an invalid binding was specified.

setBinding

public final void setBinding(short bindingType)
                      throws ServiceException
Sets the RMI binding type. The type must be one of:
Parameters:
bindingType - RMI binding type.
Throws:
ServiceException - if an invalid binding type is specified.

getBindName

public final String getBindName()
Gets the name by which the remote/activatable object is to be bound to the rmiregistry.
Returns:
The name by which the remote/activatable object is to be bound to the rmiregistry.

setBindName

public final void setBindName(String bindName)
Sets the name to be bound to the rmiregistry.
Parameters:
bindName - The name by which the remote/activatable object is to be bound.

isRegisterWithRMI

public final boolean isRegisterWithRMI()
Gets the preference to bind or not to bind a remote object to the rmiregistry.
Returns:
true if the remote is to be bound to the rmiregistry.

isRebind

public final boolean isRebind()
Gets the preference to rebind or bind when associating a remote with an rmiregistry.
Returns:
true if the remote is to be associated with an rmiregistry using a "rebind" which will replace any currently registered remote or false if a "bind" is desired. Note that if a "bind" is requested and a remote is already registered, then the registration will fail.

isBind

public final boolean isBind()
Determines whether or not the remote is associated with an RMI registry via a "bind".
Returns:
true if the remote is to be associated with an rmiregistry using a "bind".

isNamingLookup

public final boolean isNamingLookup()
Determines whether or not a naming lookup should be done to obtain a remote object..
Returns:
true if a naming lookup should occur. If false then check isRebind() to determine whether a remote object should be registered with RMI via a rebind or bind operation.

setRegisterWithRMI

public final void setRegisterWithRMI(boolean registerWithRMI)
Specifies whether or not to bind the remote object to the rmiregistry.
Parameters:
registerWithRMI - true if the remote is to be bound to the rmiregistry.

getRMIConfiguration

public final RMIConfiguration getRMIConfiguration()
Gets the RMI configuration, host and port, for this binding.
Returns:
RMI configuration.

setRMIConfiguration

public final void setRMIConfiguration(RMIConfiguration rmiConfiguration)
Sets the RMI configuration that describes the host and port.
Parameters:
rmiConfiguration - RMI configuration associated with this binding.

isActivatable

public final boolean isActivatable()
Determines whether or not this binding contains an RMI activatable object.
Returns:
true if an activatable object is defined and false if one isn't defined.

getActivatable

public final ActivatableWrapper getActivatable()
Gets a wrapper class encapsulating an RMI activatable object.
Returns:
A wrapper class containing an RMI activatable object.

setActivatable

public final void setActivatable(ActivatableWrapper activatableWrapper)
Sets the activatable.
Parameters:
activatableWrapper - Wrapper encapsulating an RMI activatable object.

getRemoteObject

public final Remote getRemoteObject()
Gets the remote object.
Returns:
Remote object.

setRemoteObject

public final void setRemoteObject(Remote remoteObject)
Sets the remote object to be bound to the rmiregistry.
Parameters:
remoteObject - Remote object to be bound to RMI.

getUrl

public final String getUrl()
Gets the URL used to access the RMI service via its bind name at the using the RMI configuration.
Returns:
URL used to bind a name to an rmiregistry.

deploy

public RemoteServiceInterface deploy()
                              throws ServiceException
Deploys the class in-process (within the same JVM). The following deployment modes are supported:
Specified by:
deploy in interface DeployInterface
Returns:
Deployed service.
Throws:
ServiceException - if unable to deploy the service.

toString

public final String toString()
Gets a string representation of this instance. Intended for debugging purposes.
Overrides:
toString in class Object
Returns:
Debug statement describing this instance.

unbind

public final void unbind()
Unbinds the name binding from the RMI registry.

***  This API provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:28:53