|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.turbine.services.uniqueid.TurbineUniqueIdService
This is an implementation of UniqueIdService
.
Field Summary | |
protected static int |
counter
|
protected static java.lang.String |
turbineId
The identifier of this instance of turbine. |
protected static java.lang.String |
turbineURL
|
Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
Fields inherited from interface org.apache.turbine.services.uniqueid.UniqueIdService |
SERVICE_NAME |
Constructor Summary | |
TurbineUniqueIdService()
|
Method Summary | |
java.lang.String |
getInstanceId()
Returns an identifier of this Turbine instance that is unique both on the server and worldwide. |
java.lang.String |
getPseudorandomId()
Returns a unique identifier that looks like random data. |
java.lang.String |
getUniqueId()
Returns an identifier that is unique within this turbine instance, but does not have random-like apearance. |
void |
init()
Initializes the service upon first Turbine.doGet() invocation. |
void |
init(RunData data)
Performs early initialization. |
void |
shutdown()
Writes a message to the log upon system shutdown. |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, init |
Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Service |
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, init, setInitableBroker |
Field Detail |
protected static java.lang.String turbineId
protected static java.lang.String turbineURL
protected static int counter
Constructor Detail |
public TurbineUniqueIdService()
Method Detail |
public void init(RunData data) throws InitializationException
TurbineBaseService
init
in class TurbineBaseService
data
- An RunData to use for initialization activities.
InitializationException
- if initialization of this
class was not successful.public void init() throws InitializationException
Initializes the service upon first Turbine.doGet() invocation.
init
in interface Initable
init
in class TurbineBaseService
InitializationException
public void shutdown()
Writes a message to the log upon system shutdown.
shutdown
in interface Initable
shutdown
in class TurbineBaseService
public java.lang.String getInstanceId()
Returns an identifier of this Turbine instance that is unique both on the server and worldwide. This identifier is computed as an MD5 sum of the URL (including schema, address, port if different that 80/443 respecively, context and servlet name). There is an overwhelming probalility that this id will be different that all other Turbine instances online.
getInstanceId
in interface UniqueIdService
public java.lang.String getUniqueId()
Returns an identifier that is unique within this turbine instance, but does not have random-like apearance.
getUniqueId
in interface UniqueIdService
public java.lang.String getPseudorandomId()
Returns a unique identifier that looks like random data.
getPseudorandomId
in interface UniqueIdService
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |