jaugment2.jini.simpleService
Class simpleService

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--jaugment2.jini.simpleService.simpleService
Direct Known Subclasses:
BatteryService, ClockService, CmdlnSpeakerService, DirectoryService, JavaMailService, JavaSpeechService, MediaPlayerService, PasswordService, RememberanceAgentService, SemiNaturalVoiceProcessorService, SSHService, TextEditorService, TickerService, UIService, VerySimpleService

public abstract class simpleService
extends java.rmi.server.UnicastRemoteObject
implements com.sun.jini.admin.DestroyAdmin, StoppableAdmin, Savable, com.sun.jini.admin.StorageLocationAdmin

A simple base to build a JINI-service on.

See Also:
Serialized Form

Inner Class Summary
protected  class simpleService.myServiceIDListener
           
 
Field Summary
private  java.util.LinkedList bindings
          LinkedList of Binding with the additional bindings used
private  net.jini.core.entry.Entry[] fallback_attrSets
           
(package private)  net.jini.lookup.JoinManager jmngr
           
(package private)  net.jini.discovery.LookupDiscoveryManager ldm
           
(package private)  net.jini.lease.LeaseRenewalManager lrm
           
 java.util.Properties persistentState
           
(package private)  java.lang.Object proxy
           
 net.jini.core.lookup.ServiceID sid
           
private static boolean simpleservicedebugMessages
           
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
csf, port, portFactoryParamTypes, portParamTypes, serialVersionUID, ssf
 
Fields inherited from class java.rmi.server.RemoteServer
log, logname, serialVersionUID
 
Fields inherited from class java.rmi.server.RemoteObject
ref, serialVersionUID
 
Constructor Summary
simpleService()
           
 
Method Summary
(package private)  void ()
           
(package private)  void ()
           
 void deinit()
          Deregister from all registrars and additional Bindings
private  void deinitBindings()
           
abstract  void destroy()
          stop this service, destroy any persistent storage and exit
protected  void finalize()
           
 java.lang.Object getProxy()
           
 net.jini.core.lookup.ServiceItem getServiceItem()
          returns our service-item (if we do not have a ServiceID yet the sid will be (-1|-1))
 java.lang.String getStorageLocation()
          get the location of persistent storage
 void init(java.lang.Object proxy, net.jini.core.entry.Entry[] attrSets, java.lang.Object This, net.jini.core.discovery.LookupLocator firstLocator)
           
private  void initBindings()
           
private  void initBindings(java.util.LinkedList a)
           
 void load()
          Load persistent state If the file does not exist it is created with the content of prop.
abstract  void restart()
          restart this service once it has been stopped
 void save()
          Write persistent state(argument prop) into the file given by the property "persistentStateFilename".
 void setStorageLocation(java.lang.String p0)
          Set the location of persistent storage
abstract  void stop(boolean exit)
          stop this service.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, readObject, reexport, 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, writeObject
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

simpleservicedebugMessages

private static final boolean simpleservicedebugMessages

ldm

net.jini.discovery.LookupDiscoveryManager ldm

lrm

net.jini.lease.LeaseRenewalManager lrm

jmngr

net.jini.lookup.JoinManager jmngr

fallback_attrSets

private net.jini.core.entry.Entry[] fallback_attrSets

proxy

java.lang.Object proxy

sid

public net.jini.core.lookup.ServiceID sid

persistentState

public java.util.Properties persistentState

bindings

private java.util.LinkedList bindings
LinkedList of Binding with the additional bindings used
Constructor Detail

simpleService

public simpleService()
              throws java.rmi.RemoteException
Method Detail

getProxy

public java.lang.Object getProxy()

getServiceItem

public net.jini.core.lookup.ServiceItem getServiceItem()
returns our service-item (if we do not have a ServiceID yet the sid will be (-1|-1))

deinit

public void deinit()
Deregister from all registrars and additional Bindings

init

public void init(java.lang.Object proxy,
                 net.jini.core.entry.Entry[] attrSets,
                 java.lang.Object This,
                 net.jini.core.discovery.LookupLocator firstLocator)
          throws java.io.IOException

initBindings

private void initBindings()

initBindings

private void initBindings(java.util.LinkedList a)

deinitBindings

private void deinitBindings()

restart

public abstract void restart()
                      throws java.lang.Exception
restart this service once it has been stopped
Specified by:
restart in interface StoppableAdmin
See Also:
stop

void ()
Overrides:
in class java.rmi.server.UnicastRemoteObject

stop

public abstract void stop(boolean exit)
                   throws java.lang.Exception
stop this service. If exit is false all references to this service are still valid but it has deregistered everywhere. (this includes the RMI-activation-daemon)
Specified by:
stop in interface StoppableAdmin
Parameters:
exit - stop running
See Also:
restart, destroy

void ()
Overrides:
in class java.rmi.server.UnicastRemoteObject

destroy

public abstract void destroy()
                      throws java.rmi.RemoteException
stop this service, destroy any persistent storage and exit
Specified by:
destroy in interface com.sun.jini.admin.DestroyAdmin

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object

getStorageLocation

public java.lang.String getStorageLocation()
get the location of persistent storage
Specified by:
getStorageLocation in interface com.sun.jini.admin.StorageLocationAdmin

setStorageLocation

public void setStorageLocation(java.lang.String p0)
Set the location of persistent storage
Specified by:
setStorageLocation in interface com.sun.jini.admin.StorageLocationAdmin

save

public void save()
Write persistent state(argument prop) into the file given by the property "persistentStateFilename".
Specified by:
save in interface Savable

load

public void load()
Load persistent state If the file does not exist it is created with the content of prop.