org.starhope.catullus
Class GaiusValeriusCatullus

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.starhope.catullus.GaiusValeriusCatullus
All Implemented Interfaces:
Serializable, Remote, JavaRMIServer

public class GaiusValeriusCatullus
extends UnicastRemoteObject
implements JavaRMIServer

Gaius Valerius Catullus is the class moving data around between the client and server … WRITEME

Author:
brpocock@star-hope.org
See Also:
Serialized Form

Nested Class Summary
(package private) static class GaiusValeriusCatullus.BoringSocketFactory
          WRITEME: Document this type.
(package private) static class GaiusValeriusCatullus.LocalServerSocketFactory
          a simple factory to emit server sockets for RMI
 
Field Summary
private  Registry registry
          WRITEME: Document this brpocock@star-hope.org
private static long serialVersionUID
          Java serialisation unique ID
private  String serviceName
          The name used for RMI binding; defaults to org.starhope.catullus.serviceName in the configuration, or, failing that, C.Valerius.Catullus
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
GaiusValeriusCatullus()
          default no-op constructor.
GaiusValeriusCatullus(String newServiceName)
          default no-op constructor
 
Method Summary
private
<T extends DataRecord,S extends T>
T
getLocalPeer(S obj)
          get a local peer class
<T extends DataRecord>
T
read(Class<T> klass, int id)
          WRITEME: Document this method brpocock@star-hope.org
<T extends DataRecord>
T
read(Class<T> klass, String ident)
          WRITEME: Document this method brpocock@star-hope.org
<T extends DataRecord>
void
remove(T obj)
          WRITEME: Document this method brpocock@star-hope.org
private static
<T extends DataRecord>
void
setAll_annotatedClass(T dest, T source, Class<T> klass)
          set all properties for an annotated class (using the Setter annotations and such)
private static
<T> String
setAll_getSetter(Class<T> klass, Method m)
          figure out what getter goes with a given setter
private static
<T> void
setAll_setFromGetter(T dest, T source, Class<T> klass, Method m, String getName, Class<?>[] parameterTypes, Class<?> kind, Method getter)
          set a property from a given getter
(package private) static
<T extends DataRecord>
T
setAll(T dest, T source)
          set all properties of a data record based upon its peer
<T extends DataRecord>
T
write(T obj)
          WRITEME: Document this method brpocock@star-hope.org
<T extends DataRecord>
T
writeSync(T obj)
          WRITEME: Document this method brpocock@star-hope.org
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Java serialisation unique ID

See Also:
Constant Field Values

registry

private final transient Registry registry
WRITEME: Document this brpocock@star-hope.org


serviceName

private final String serviceName
The name used for RMI binding; defaults to org.starhope.catullus.serviceName in the configuration, or, failing that, C.Valerius.Catullus

Constructor Detail

GaiusValeriusCatullus

public GaiusValeriusCatullus()
                      throws RemoteException,
                             NotReadyException
default no-op constructor. Takes service name from the configuration.

Throws:
RemoteException - WRITEME
NotReadyException - WRITEME

GaiusValeriusCatullus

public GaiusValeriusCatullus(String newServiceName)
                      throws NotReadyException,
                             RemoteException
default no-op constructor

Parameters:
newServiceName - WRITEME
Throws:
NotReadyException - WRITEME
RemoteException - WRITEME
Method Detail

setAll

static <T extends DataRecord> T setAll(T dest,
                                       T source)
                            throws DataException
set all properties of a data record based upon its peer

Type Parameters:
T - type of the source and destination
Parameters:
dest - the object to be altered to match the other
source - the source from which properties are to be copied
Returns:
the destination (for chaining)
Throws:
DataException - if the objects aren't compatible

setAll_annotatedClass

private static <T extends DataRecord> void setAll_annotatedClass(T dest,
                                                                 T source,
                                                                 Class<T> klass)
                                   throws SecurityException,
                                          DataException
set all properties for an annotated class (using the Setter annotations and such)

Type Parameters:
T - WRITEME
Parameters:
dest - WRITEME
source - WRITEME
klass - WRITEME
Throws:
SecurityException - WRITEME
DataException - WRITEME

setAll_getSetter

private static <T> String setAll_getSetter(Class<T> klass,
                                           Method m)
                                throws DataException
figure out what getter goes with a given setter

Type Parameters:
T - WRITEME
Parameters:
klass - WRITEME
m - WRITEME
Returns:
WRITEME
Throws:
DataException - WRITEME

setAll_setFromGetter

private static <T> void setAll_setFromGetter(T dest,
                                             T source,
                                             Class<T> klass,
                                             Method m,
                                             String getName,
                                             Class<?>[] parameterTypes,
                                             Class<?> kind,
                                             Method getter)
                                  throws DataException
set a property from a given getter

Type Parameters:
T - WRITEME
Parameters:
dest - WRITEME
source - WRITEME
klass - WRITEME
m - WRITEME
getName - WRITEME
parameterTypes - WRITEME
kind - WRITEME
getter - WRITEME
Throws:
DataException - WRITEME

getLocalPeer

private <T extends DataRecord,S extends T> T getLocalPeer(S obj)
get a local peer class

Type Parameters:
T - class to locate
S - the specific class of the peer
Parameters:
obj - object whose peer to find
Returns:
peer found

read

public <T extends DataRecord> T read(Class<T> klass,
                                     int id)
                          throws NotFoundException
Description copied from interface: JavaRMIServer
WRITEME: Document this method brpocock@star-hope.org

Specified by:
read in interface JavaRMIServer
Type Parameters:
T - WRITEME
Parameters:
klass - WRITEME
id - WRITEME
Returns:
WRITEME
Throws:
NotFoundException - if the record isn't found
See Also:
JavaRMIServer.read(java.lang.Class, int)

read

public <T extends DataRecord> T read(Class<T> klass,
                                     String ident)
                          throws NotFoundException
Description copied from interface: JavaRMIServer
WRITEME: Document this method brpocock@star-hope.org

Specified by:
read in interface JavaRMIServer
Type Parameters:
T - WRITEME
Parameters:
klass - WRITEME
ident - WRITEME
Returns:
WRITEME
Throws:
NotFoundException - Read a data record locally
See Also:
JavaRMIServer.read(java.lang.Class, java.lang.String)

remove

public <T extends DataRecord> void remove(T obj)
Description copied from interface: JavaRMIServer
WRITEME: Document this method brpocock@star-hope.org

Specified by:
remove in interface JavaRMIServer
Type Parameters:
T - WRITEME
Parameters:
obj - WRITEME
See Also:
JavaRMIServer.remove(org.starhope.appius.util.DataRecord)

write

public <T extends DataRecord> T write(T obj)
Description copied from interface: JavaRMIServer
WRITEME: Document this method brpocock@star-hope.org

Specified by:
write in interface JavaRMIServer
Type Parameters:
T - whatever type it might be
Parameters:
obj - WRITEME
Returns:
the record just written (for chaining purposes)
See Also:
JavaRMIServer.write(DataRecord)

writeSync

public <T extends DataRecord> T writeSync(T obj)
                               throws RemoteException
Description copied from interface: JavaRMIServer
WRITEME: Document this method brpocock@star-hope.org

Specified by:
writeSync in interface JavaRMIServer
Type Parameters:
T - WRITEME
Parameters:
obj - WRITEME
Returns:
WRITEME
Throws:
RemoteException - WRITEME
See Also:
JavaRMIServer.writeSync(org.starhope.appius.util.DataRecord)