university
Class PersonAdapterImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by university.PersonAdapterImpl
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, PersonAdapter

public class PersonAdapterImpl
extends java.rmi.server.UnicastRemoteObject
implements PersonAdapter

Adapter Class for the purpose of using People from the university as remote objects

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface university.PersonAdapter
SERVICENAME
 
Constructor Summary
PersonAdapterImpl(Person p)
          Creates a new instance of PersonAdapterImpl
 
Method Summary
 Address getAddress()
          Get the Address of the Person.
 Unit getAffiliation()
          Returns the unit a person belongs to.
 Sex getGender()
          Returns the sex of a person
 int getID()
          Returns the ID of a person.
 java.lang.String getName()
          Returns the name of a person
 java.lang.String printDescription()
          Get a description of the Person.
 void setName(java.lang.String name)
          Set the persons name to a new name.
 
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
 

Constructor Detail

PersonAdapterImpl

public PersonAdapterImpl(Person p)
                  throws java.rmi.RemoteException
Creates a new instance of PersonAdapterImpl

Parameters:
p - the person object to be used by the adapter.
Throws:
java.rmi.RemoteException
Method Detail

getName

public java.lang.String getName()
                         throws java.rmi.RemoteException
Returns the name of a person

Specified by:
getName in interface PersonAdapter
Returns:
The name of the person
Throws:
java.rmi.RemoteException

setName

public void setName(java.lang.String name)
             throws java.rmi.RemoteException
Set the persons name to a new name.

Specified by:
setName in interface PersonAdapter
Parameters:
name - The name of the person.
Throws:
java.rmi.RemoteException

getGender

public Sex getGender()
              throws java.rmi.RemoteException
Returns the sex of a person

Specified by:
getGender in interface PersonAdapter
Returns:
The gender of the person
Throws:
java.rmi.RemoteException

getAffiliation

public Unit getAffiliation()
                    throws java.rmi.RemoteException
Returns the unit a person belongs to.

Specified by:
getAffiliation in interface PersonAdapter
Returns:
The unit that the person belongs to
Throws:
java.rmi.RemoteException

getID

public int getID()
          throws java.rmi.RemoteException
Returns the ID of a person.

Specified by:
getID in interface PersonAdapter
Returns:
The ID of the person
Throws:
java.rmi.RemoteException

getAddress

public Address getAddress()
                   throws java.rmi.RemoteException
Get the Address of the Person.

Specified by:
getAddress in interface PersonAdapter
Returns:
The Address of the Person.
Throws:
java.rmi.RemoteException

printDescription

public java.lang.String printDescription()
                                  throws java.rmi.RemoteException
Get a description of the Person.

Specified by:
printDescription in interface PersonAdapter
Returns:
A String representing a Person.
Throws:
java.rmi.RemoteException