*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.deployment
Class RMIBinding
java.lang.Object
com.sas.services.deployment.RMIBinding
- All Implemented Interfaces:
DeployInterface,Serializable
@SASScope("ALL")
@BinaryCompatibilityOnly
public final class RMIBinding
extends Object
implements DeployInterface, Serializable
RMI binding that associates an RMI remote object with a
name bound to an RMI registry. The RMI registry information is specified
by the associated
RMIConfiguration.- Since:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRMI binding type: bindstatic final StringRMI binding type: lookupstatic final StringRMI binding type: rebindstatic final StringString constant denoting the local host.static final shortRMI binding: bind remote to the RMI registrystatic final shortRMI binding: uninitializedstatic final shortRMI binding: lookup remote in the RMI registrystatic final shortRMI binding: rebind remote to the RMI registry -
Constructor Summary
ConstructorsConstructorDescriptionRMIBinding(RMIConfiguration rmiConfiguration, String bindName, short binding) Constructor specifying the RMI configuration and the bind name for the RMI remote/activatable object. -
Method Summary
Modifier and TypeMethodDescriptiondeploy()Deploys the class in-process (within the same JVM).Gets a wrapper class encapsulating an RMI activatable object.static shortgetBinding(String bindingType) Translates a string value representing the binding to a short.StringGets the name by which the remote/activatable object is to be bound to the RMI registry.RemoteGets the remote object.Gets the RMI configuration, host and port, for this binding.StringgetUrl()Gets the URL used to access the RMI service via its bind name at the using the RMI configuration.booleanDetermines whether or not this binding contains an RMI activatable object.booleanisBind()Determines whether or not the remote is associated with an RMI registry via a "bind".booleanDetermines whether or not a naming lookup should be done to obtain a remote object..booleanisRebind()Gets the preference to rebind or bind when associating a remote with an RMI registry.booleanGets the preference to bind or not to bind a remote object to the RMI registry.voidsetActivatable(ActivatableWrapper activatableWrapper) Sets the activatable.voidsetBinding(short bindingType) Sets the RMI binding type.voidsetBindName(String bindName) Sets the name to be bound to the RMI registry.voidsetRegisterWithRMI(boolean registerWithRMI) Specifies whether or not to bind the remote object to the RMI registry.voidsetRemoteObject(Remote remoteObject) Sets the remote object to be bound to the RMI registry.voidsetRMIConfiguration(RMIConfiguration rmiConfiguration) Sets the RMI configuration that describes the host and port.StringtoString()Gets a string representation of this instance.voidunbind()Removes 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 Details
-
LOCALHOST
public static final String LOCALHOSTString constant denoting the local host.- See Also:
-
BINDING_TYPE_BIND
public static final String BINDING_TYPE_BINDRMI binding type: bind- See Also:
-
BINDING_TYPE_REBIND
public static final String BINDING_TYPE_REBINDRMI binding type: rebind- See Also:
-
BINDING_TYPE_LOOKUP
public static final String BINDING_TYPE_LOOKUPRMI binding type: lookup- See Also:
-
RMI_BINDING_INVALID
public static final short RMI_BINDING_INVALIDRMI binding: uninitialized- See Also:
-
RMI_BINDING_BIND
public static final short RMI_BINDING_BINDRMI binding: bind remote to the RMI registry- See Also:
-
RMI_BINDING_REBIND
public static final short RMI_BINDING_REBINDRMI binding: rebind remote to the RMI registry- See Also:
-
RMI_BINDING_LOOKUP
public static final short RMI_BINDING_LOOKUPRMI binding: lookup remote in the RMI registry- See Also:
-
-
Constructor Details
-
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 RMI registry.binding- RMI binding. One of- RMI_BINDING_BIND
- RMI_BINDING_REBIND
- RMI_BINDING_LOOKUP
- Throws:
ServiceException- if unable to construct an RMI binding.
-
-
Method Details
-
getBinding
public static short getBinding(String bindingType) Translates a string value representing the binding to a short.- Parameters:
bindingType- RMI binding type which must be one of "RMI_REBIND", "RMI_BIND" or "RMI_LOOKUP".- Returns:
- Code representing the RMI binding or
RMIBinding.RMI_BINDING_INVALIDif an invalid binding was specified.
-
setBinding
Sets the RMI binding type. The type must be one of:- RMIBinding.RMI_BINDING_BIND
- RMIBinding.RMI_BINDING_REBIND
- RMIBinding.RMI_BINDING_LOOKUP
- Parameters:
bindingType- RMI binding type.- Throws:
ServiceException- if an invalid binding type is specified.
-
getBindName
public String getBindName()Gets the name by which the remote/activatable object is to be bound to the RMI registry.- Returns:
- The name by which the remote/activatable object is to be bound to the RMI registry.
-
setBindName
public void setBindName(String bindName) Sets the name to be bound to the RMI registry.- Parameters:
bindName- The name by which the remote/activatable object is to be bound.
-
isRegisterWithRMI
public boolean isRegisterWithRMI()Gets the preference to bind or not to bind a remote object to the RMI registry.- Returns:
trueif the remote is to be bound to the RMI registry.
-
isRebind
public boolean isRebind()Gets the preference to rebind or bind when associating a remote with an RMI registry.- Returns:
trueif the remote is to be associated with an RMI registry using a "rebind" which will replace any currently registered remote orfalseif a "bind" is desired. Note that if a "bind" is requested and a remote is already registered, then the registration will fail.
-
isBind
public boolean isBind()Determines whether or not the remote is associated with an RMI registry via a "bind".- Returns:
trueif the remote is to be associated with an RMI registry using a "bind".
-
isNamingLookup
public boolean isNamingLookup()Determines whether or not a naming lookup should be done to obtain a remote object..- Returns:
trueif a naming lookup should occur. Iffalsethen check isRebind() to determine whether a remote object should be registered with RMI via a rebind or bind operation.
-
setRegisterWithRMI
public void setRegisterWithRMI(boolean registerWithRMI) Specifies whether or not to bind the remote object to the RMI registry.- Parameters:
registerWithRMI-trueif the remote is to be bound to the RMI registry.
-
getRMIConfiguration
Gets the RMI configuration, host and port, for this binding.- Returns:
- RMI configuration.
-
setRMIConfiguration
Sets the RMI configuration that describes the host and port.- Parameters:
rmiConfiguration- RMI configuration associated with this binding.
-
isActivatable
public boolean isActivatable()Determines whether or not this binding contains an RMI activatable object.- Returns:
trueif an activatable object is defined andfalseif one isn't defined.
-
getActivatable
Gets a wrapper class encapsulating an RMI activatable object.- Returns:
- A wrapper class containing an RMI activatable object.
-
setActivatable
Sets the activatable.- Parameters:
activatableWrapper- Wrapper encapsulating an RMI activatable object.
-
getRemoteObject
public Remote getRemoteObject()Gets the remote object.- Returns:
- Remote object.
-
setRemoteObject
public void setRemoteObject(Remote remoteObject) Sets the remote object to be bound to the RMI registry.- Parameters:
remoteObject- Remote object to be bound to RMI.
-
getUrl
public 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 RMI registry.
-
deploy
Deploys the class in-process (within the same JVM). The following deployment modes are supported:- Binding of a remote object to the RMI registry
- Lookup of a preexisting remote object in the RMI registry
- Specified by:
deployin interfaceDeployInterface- Returns:
- Deployed service.
- Throws:
ServiceException- if unable to deploy the service.- See Also:
-
toString
public String toString()Gets a string representation of this instance. Intended for debugging purposes.- Overrides:
toStringin classObject- Returns:
- Debug statement describing this instance.
-
unbind
public void unbind()Removes the name binding from the RMI registry.
-