SmartFrog 3.10.000

org.smartfrog.sfcore.reference
Class HostReferencePart

java.lang.Object
  extended by org.smartfrog.sfcore.reference.ReferencePart
      extended by org.smartfrog.sfcore.reference.HostReferencePart
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Copying

public class HostReferencePart
extends ReferencePart

Implements the host reference part.

See Also:
Serialized Form

Field Summary
static java.lang.String HOST
          String representation of this part.
 java.lang.String hostname
          Hostname for the HOST reference part.
 
Constructor Summary
HostReferencePart(java.lang.String hostname)
          Constructs HostReferencePart for some host.
 
Method Summary
 ReferencePart asHostReferencePart()
          Returns this object since this is already a host reference part.
 boolean equals(java.lang.Object refPart)
          Compares this reference part with another one.
protected  java.net.InetAddress getAddress()
          Returns InetAddress of the host.
 int hashCode()
          Returns hashcode of this part.
 java.lang.Object resolve(ReferenceResolver rr, Reference r, int index)
          Resolves this reference part using the given reference resolver.
 java.lang.Object resolve(RemoteReferenceResolver rr, Reference r, int index)
          Resolves this reference part using the given remote reference resolver.
 java.lang.String toString()
          Returns a string representation of the reference part.
 
Methods inherited from class org.smartfrog.sfcore.reference.ReferencePart
attrib, clone, copy, forwardReference, here, host, iproperty, parent, process, property, root, thisref, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HOST

public static final java.lang.String HOST
String representation of this part.

See Also:
Constant Field Values

hostname

public java.lang.String hostname
Hostname for the HOST reference part.

Constructor Detail

HostReferencePart

public HostReferencePart(java.lang.String hostname)
Constructs HostReferencePart for some host.

Parameters:
hostname - hostname for the process compound referenced
Method Detail

asHostReferencePart

public ReferencePart asHostReferencePart()
Returns this object since this is already a host reference part.

Returns:
this part

getAddress

protected java.net.InetAddress getAddress()
                                   throws java.lang.Exception
Returns InetAddress of the host.

Returns:
InetAddress of the host
Throws:
java.lang.Exception - failed to find the inetAddress

toString

public java.lang.String toString()
Returns a string representation of the reference part. Implements abstract method ReferencePart.toString.

Specified by:
toString in class ReferencePart
Returns:
stringified reference part

equals

public boolean equals(java.lang.Object refPart)
Compares this reference part with another one. Equality means that the other refPart is a HostReferencePart and the hostnames are string equal.

Specified by:
equals in class ReferencePart
Parameters:
refPart - to be compared to
Returns:
true if equal, false if not

hashCode

public int hashCode()
Returns hashcode of this part. Implements abstract method ReferencePart.hashCode.

Specified by:
hashCode in class ReferencePart
Returns:
hash code for part, the hashcode of the hostname

resolve

public java.lang.Object resolve(ReferenceResolver rr,
                                Reference r,
                                int index)
                         throws SmartFrogResolutionException
Resolves this reference part using the given reference resolver. This forwards the reference to the parent if it exists or to the actual component if the root is found (parent== null). The originating reference and index are needed to forward the request to the parent or component.

Specified by:
resolve in class ReferencePart
Parameters:
rr - reference resolver
r - reference which this part sits in
index - index of this reference part in r
Returns:
the attribute found on resolution
Throws:
SmartFrogResolutionException - if failed to resolve reference

resolve

public java.lang.Object resolve(RemoteReferenceResolver rr,
                                Reference r,
                                int index)
                         throws SmartFrogResolutionException
Resolves this reference part using the given remote reference resolver. This forwards the reference to the parent if it exists or to the actual component if the root is found (parent== null). The originating reference and index are needed to forward the request to the parent or component.

Specified by:
resolve in class ReferencePart
Parameters:
rr - reference resolver
r - reference which this part sits in
index - index of this reference part in r
Returns:
the attribute found on resolution
Throws:
SmartFrogResolutionException - if failed to resolve reference

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP