class ServiceType extends Object implements Serializable
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?)
Modifier and Type | Field and Description |
---|---|
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.
|
Modifier | Constructor and Description |
---|---|
|
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.
|
Modifier and Type | Method and Description |
---|---|
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() |
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
public ServiceType(Class clazz, ServiceType superclass, ServiceType[] interfaces) throws MarshalException
MarshalException
private ServiceType(ServiceType stype)
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 classtype
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 fromIOException
ClassNotFoundException
public boolean equals(Object o)
public int hashCode()
private void computeHash() throws IOException, NoSuchAlgorithmException
IOException
NoSuchAlgorithmException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
private void readObjectNoData() throws InvalidObjectException
InvalidObjectException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.