|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.reggie.ServiceType
class ServiceType
A ServiceType is a descriptor for a class, packaged up for transmission between client-side proxies and the registrar server. Instances are never visible to clients, they are private to the communication between the proxies and the server.
This class only has a bare minimum of methods, to minimize the amount of code downloaded into clients.
see ClassResolver (com.sun.jini.reggie.test.share.ClassResolver?)
Field Summary | |
---|---|
private static ServiceType[] |
empty
|
protected long |
hash
Hash for the type |
private boolean |
integrity
Flag set to true if this instance was unmarshalled from an integrity-protected stream, or false otherwise |
protected ServiceType[] |
interfaces
Descriptor for the interfaces. |
private String |
name
Class name. |
protected ServiceType |
replacement
An instance containing only name, no supertype info. |
private static long |
serialVersionUID
|
protected ServiceType |
superclass
Descriptor for the superclass. |
Constructor Summary | |
---|---|
|
ServiceType(Class clazz,
ServiceType superclass,
ServiceType[] interfaces)
Should only be called by ClassMapper |
private |
ServiceType(ServiceType stype)
Constructor used for creating replacement instances, containing only name. |
Method Summary | |
---|---|
private void |
computeHash()
Computes a SHA-1 digest from the hash of the superclass, if there is a superclass, followed by the name of this class, followed by the name and type for each field, if any, declared by this class and ordered alphabetically by field name. |
boolean |
equals(Object o)
Returns true if the object passed in is an instance of Type with the same type hash. |
ServiceType[] |
getInterfaces()
Return the interfaces. |
String |
getName()
Returns the name of this type |
ServiceType |
getReplacement()
Return the replacement, if any, containing only name and rep. |
ServiceType |
getSuperclass()
Return the superclass descriptor |
int |
hashCode()
Return a hashcode for this type. |
boolean |
isAssignableFrom(ServiceType cls)
Returns true if this type is equal to type or if this type
is equal to a superclass of type . |
private boolean |
isAssignableFrom(ServiceType[] ifaces)
Test if this isAssignableFrom any of the given interface types. |
boolean |
isInterface()
|
private void |
readObject(ObjectInputStream in)
Samples integrity protection setting (if any) of the stream from which this instance is being deserialized. |
private void |
readObjectNoData()
Throws InvalidObjectException, since data for this class is required. |
Class |
toClass(String codebase)
Converts this descriptor to a Class instance, loading from codebase |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final ServiceType[] empty
private String name
protected long hash
protected ServiceType superclass
protected ServiceType[] interfaces
protected transient ServiceType replacement
private transient boolean integrity
Constructor Detail |
---|
public ServiceType(Class clazz, ServiceType superclass, ServiceType[] interfaces) throws MarshalException
MarshalException
private ServiceType(ServiceType stype)
Method Detail |
---|
public String getName()
public ServiceType getSuperclass()
public ServiceType[] getInterfaces()
public ServiceType getReplacement()
private boolean isAssignableFrom(ServiceType[] ifaces)
public boolean isInterface()
Class.isInterface()
public boolean isAssignableFrom(ServiceType cls)
type
or if this type
is equal to a superclass of type
.
cls
- Type to check if subclass of this class
type
is a subclass of this type, false
otherwiseClass.isAssignableFrom(java.lang.Class>)
public Class toClass(String codebase) throws IOException, ClassNotFoundException
codebase
- String the codebase to load the class from
IOException
ClassNotFoundException
public boolean equals(Object o)
equals
in class Object
o
- object to compare this object against
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
private void computeHash() throws IOException, NoSuchAlgorithmException
IOException
NoSuchAlgorithmException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
private void readObjectNoData() throws InvalidObjectException
InvalidObjectException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |