|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sun.jini.outrigger.OutriggerServerImpl
A basic implementation of a JavaSpacesTM
service. This class is designed for use by both transient and
persistent instances. Persistence is delegated to Store
and LogOps objects which handles the details
of implementing a particular persistence strategy. If transient
a null value is used for the LogOps object.
OutriggerServerImpl maintains a list of types of
entries it has seen and their subtypes using a
TypeTree object. Each type of entry has an
EntryHolder that is stored in the
EntryHolderSet object named contents.
On write, the written entry's class and superclass are
added to the known types, and its EntryRep
is added to the space's contents.
On read, the find method searches through
the entries of its type and subtypes, asking each entry holder if it
has an entry that matches the template. If a match is found, the
matching EntryRep is returned. If none of the
appropriate holders has a match, it will return null.
On take we also use find with a
boolean that says to remove the entry that matches.
Notification requires a separate Notifier queue and
thread. When an entry is written, a reference to it is added to the
queue of "unexamined entries". The notifier thread pulls entries
off the queue and checks them against registered notification
templates. When it has found all matches for the template, the
Notifier thread adds the notifications for this write
to its list of undelivered notifications, which it periodically
attempts to deliver.
On notify, the template is added to the
TemplateHolderSet named template. This
stores TemplateHolder objects for each known type.
In this implementation, EntryRep ID's are approximate
time stamps.
| Nested Class Summary | |
static interface |
OutriggerServer.QueryCookie
Marker interface for objects that represent state that the server finds useful to share across sub-queries. |
| Nested classes inherited from class com.sun.jini.landlord.Landlord |
Landlord.RenewResults |
| Field Summary | |
static String |
COMPONENT_NAME
Component name we use to find items in the configuration and loggers. |
static String |
PERSISTENCE_DIR_CONFIG_ENTRY
The name of the configuration entry we use to get the the name of the log directory from. |
static String |
storeLoggerName
Logger name for information related to persistence |
| Fields inherited from interface net.jini.core.transaction.server.TransactionConstants |
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING |
| Fields inherited from interface com.sun.jini.constants.TimeConstants |
DAYS, HOURS, MINUTES, SECONDS |
| Method Summary | |
void |
abort(TransactionManager mgr,
long id)
Requests that the participant roll back any changes for the specified transaction and unlock any resources locked by the transaction. |
void |
addLookupAttributes(Entry[] attrSets)
Add attribute sets for the service. |
void |
addLookupGroups(String[] groups)
Add new groups to the set to join. |
void |
addLookupLocators(LookupLocator[] locators)
Add locators for specific new lookup services to join. |
void |
cancel(Uuid cookie)
Cancel the lease that is associated with the given cookie. |
Map |
cancelAll(Uuid[] cookies)
Called by the lease map when its cancelAll method is called. |
void |
close(Uuid iterationUuid)
Forget about the indicated iteration |
void |
commit(TransactionManager mgr,
long id)
Requests that the participant make all of its PREPARED
changes for the specified transaction visible outside of the
transaction and unlock any resources locked by the transaction.
|
com.sun.jini.outrigger.MatchSetData |
contents(com.sun.jini.outrigger.EntryRep[] tmpls,
Transaction tr,
long leaseTime,
long limit)
Start a new contents query. |
Uuid |
contents(com.sun.jini.outrigger.EntryRep tmpl,
Transaction tr)
Return the remote iterator object needed by JavaSpaceAdmin.contents. |
void |
delete(Uuid iterationUuid,
Uuid entryUuid)
Delete the given entry if the given iteration is still valid and the entry was retured by the last call to nextReps. |
void |
destroy()
Destroy this space, exiting when finished. |
Object |
getAdmin()
Return a proxy that implements that JavaSpaceAdmin
interface. |
Entry[] |
getLookupAttributes()
Get the current attribute sets for the service. |
String[] |
getLookupGroups()
Get the list of groups to join. |
LookupLocator[] |
getLookupLocators()
Get the list of locators of specific lookup services to join. |
TrustVerifier |
getProxyVerifier()
Returns a TrustVerifier that can be used to verify that
a proxy can be trusted as a proxy for the service; that is, the
isTrustedObject method of the
returned verifier can be called with a candidate proxy. |
Object |
getServiceProxy()
Returns a proxy object for this object. |
void |
modifyLookupAttributes(Entry[] attrSetTemplates,
Entry[] attrSets)
Modify the current attribute sets, using the same semantics as ServiceRegistration.modifyAttributes. |
com.sun.jini.outrigger.EntryRep[] |
nextBatch(Uuid contentsQueryUuid,
Uuid entryUuid)
Return the next batch of entries associated with the specified contents query. |
com.sun.jini.outrigger.EntryRep[] |
nextReps(Uuid iterationUuid,
int max,
Uuid entryUuid)
Fetch up to max EntryRep objects from
the specified iteration. |
EventRegistration |
notify(com.sun.jini.outrigger.EntryRep tmpl,
Transaction tr,
RemoteEventListener listener,
long leaseTime,
MarshalledObject handback)
When entries are written that match this template notify the given listener. |
int |
prepare(TransactionManager mgr,
long id)
Requests that the participant prepare itself to commit the transaction, and to vote on the outcome of the transaction. |
int |
prepareAndCommit(TransactionManager mgr,
long id)
A combination of prepare and commit, which
can be used by the manager when there is just one participant left to
prepare and all other participants (if any) have responded with
NOTCHANGED. |
Object |
read(com.sun.jini.outrigger.EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
Find an entry in the space that matches the passed template and is visible to the passed transaction. |
Object |
readIfExists(com.sun.jini.outrigger.EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
Find an entry in the space that matches the passed template and is visible to the passed transaction. |
void |
recoverJoinState(StoredObject state)
Recover the join state from the previous session. |
void |
recoverRegister(StoredResource registration,
String type,
StoredObject[] storedTemplates)
Recover an event registration. |
void |
recoverSessionId(long sessionId)
Recover the id from the previous session and determine the new basis value for the seq numbers issued by this session. |
void |
recoverTake(Uuid cookie,
Long txnId)
Recover a take operation. |
void |
recoverTransaction(Long txnId,
StoredObject transaction)
Recover a prepared transaction. |
void |
recoverUuid(Uuid uuid)
Recover the Uuid for the service as a whole.
|
void |
recoverWrite(StoredResource entry,
Long txnId)
Recover a write operation. |
EventRegistration |
registerForAvailabilityEvent(com.sun.jini.outrigger.EntryRep[] tmpls,
Transaction tr,
boolean visibilityOnly,
RemoteEventListener listener,
long leaseTime,
MarshalledObject handback)
When entries that match one or more of the passed templates transition from invisible to visible notify the give listener. |
void |
removeLookupGroups(String[] groups)
Remove groups from the set to join. |
void |
removeLookupLocators(LookupLocator[] locators)
Remove locators for specific lookup services from the set to join. |
long |
renew(Uuid cookie,
long extension)
Renew the lease that is associated with the given cookie. |
Landlord.RenewResults |
renewAll(Uuid[] cookies,
long[] extensions)
Called by the lease map when its renewAll method is called. |
void |
setLookupGroups(String[] groups)
Replace the list of groups to join with a new list. |
void |
setLookupLocators(LookupLocator[] locators)
Replace the list of locators of specific lookup services to join with a new list. |
JavaSpace |
space()
Return the space administered by this object. |
Object |
take(com.sun.jini.outrigger.EntryRep[] tmpls,
Transaction tr,
long timeout,
int limit,
OutriggerServer.QueryCookie queryCookieFromClient)
Find and remove up to limit entries in the space
that match one or more of the passed templates and are visible
to the passed transaction. |
Object |
take(com.sun.jini.outrigger.EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
Find and remove an entry in the space that matches the passed template and is visible to the passed transaction. |
Object |
takeIfExists(com.sun.jini.outrigger.EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
Find and remove an entry in the space that matches the passed template and is visible to the passed transaction. |
long[] |
write(com.sun.jini.outrigger.EntryRep[] entries,
Transaction tr,
long[] leaseTimes)
Write a set of entires into the space. |
long[] |
write(com.sun.jini.outrigger.EntryRep rep,
Transaction tr,
long lease)
Write a new entry into the space. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String COMPONENT_NAME
public static final String storeLoggerName
public static final String PERSISTENCE_DIR_CONFIG_ENTRY
| Method Detail |
public long[] write(com.sun.jini.outrigger.EntryRep rep,
Transaction tr,
long lease)
throws TransactionException,
RemoteException
com.sun.jini.outrigger.OutriggerServer
write in interface com.sun.jini.outrigger.OutriggerServerTransactionException - A transaction error occurred
RemoteException
public long[] write(com.sun.jini.outrigger.EntryRep[] entries,
Transaction tr,
long[] leaseTimes)
throws TransactionException,
RemoteException
com.sun.jini.outrigger.OutriggerServer
write in interface com.sun.jini.outrigger.OutriggerServerUuid and then the lower order bits
of the Uuid.
TransactionException - A transaction error occurred
RemoteException
public EventRegistration notify(com.sun.jini.outrigger.EntryRep tmpl,
Transaction tr,
RemoteEventListener listener,
long leaseTime,
MarshalledObject handback)
throws TransactionException,
RemoteException
com.sun.jini.outrigger.OutriggerServerlistener. Matching is done as for read.
notify in interface com.sun.jini.outrigger.OutriggerServerTransactionException
RemoteException
public EventRegistration registerForAvailabilityEvent(com.sun.jini.outrigger.EntryRep[] tmpls,
Transaction tr,
boolean visibilityOnly,
RemoteEventListener listener,
long leaseTime,
MarshalledObject handback)
throws TransactionException,
RemoteException
com.sun.jini.outrigger.OutriggerServerlistener. Matching is done as for
read.
registerForAvailabilityEvent in interface com.sun.jini.outrigger.OutriggerServertmpls - the templates that specify what entries should
generate eventstr - if non-null entries that become
visible to txn should generate events even
if txn is never committed. Registration is
terminated when txn leaves the active statevisibilityOnly - if true, events will
be generated for this registration only when a
matching Entry transitions from
invisible to visible, otherwise events will be
generated when a matching Entry
makes any transition from unavailable to
availablelistener - object to notify when an entry becomes (re)visiblehandback - object to be included with every notification
TransactionException - if txn is
non-null and not active or otherwise invalid
RemoteException
public void cancel(Uuid cookie)
throws UnknownLeaseException
LocalLandlord
cancel in interface Landlordcookie - the Uuid associated with the lease who's
renew method was called
UnknownLeaseException - if landlord does not know about
a lease with the specified cookie
public long renew(Uuid cookie,
long extension)
throws UnknownLeaseException,
LeaseDeniedException
LocalLandlord
renew in interface Landlordcookie - the Uuid associated with the lease who's
renew method was calledextension - argument passed to the renew call
UnknownLeaseException - if landlord does not know about
a lease with the specified cookie
LeaseDeniedException - if the landlord is unwilling to
renew the lease
public Landlord.RenewResults renewAll(Uuid[] cookies,
long[] extensions)
LandlordrenewAll method is called. Should renew the lease that is
associated with each element of cookies
renewAll in interface Landlordcookies - an array of Uuids, each universally and
uniquely identifying a lease granted by this
Landlordextensions - an array of longs, each representing an a
duration in milliseconds that the client
wants the lease associated with the Uuid
from the corresponding element of
cookies renewed for
public Map cancelAll(Uuid[] cookies)
LandlordcancelAll method is called. Should cancel the lease that is
associated with each element of cookies
cancelAll in interface Landlordcookies - an array of Uuids, each universally and
uniquely identifying a lease granted by this
Landlord
cookies
could be cancelled return null. Otherwise,
return a Map that for each failed cancel
attempt maps the corresponding cookie object to an
exception describing the failure.
public Object read(com.sun.jini.outrigger.EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
throws TransactionException,
RemoteException,
InterruptedException
com.sun.jini.outrigger.OutriggerServertimeout parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie as response to the sub-queries, in
these cases it should pass the QueryCookie to the
next sub-query (if any) associated with the same request from
the client.
If a match is found it is returned as an EntryRep.
If txn is non-null the
entry is read locked by the transaction, this allows
other queries to read, but not take the entry. The lock
will be released when the transaction is aborted or prepared.
If no match is found the call will block for up to the
specified timeout for a match to appear. If there
is still no match available the call will return a
QueryCookie.
read in interface com.sun.jini.outrigger.OutriggerServertmpl - The template that describes the entry being
searched for. May be null if
any visible entry is acceptable.timeout - The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
null or a QueryCookie
(as appropriate) should be returned immediately.cookie - If this call is a continuation of
an earlier query, the cookie from the
last sub-query.
InterruptedException - if the thread in the server
is interrupted before the query can be completed.
TransactionException - if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.
RemoteException - if a network failure occurs.
public Object take(com.sun.jini.outrigger.EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
throws TransactionException,
RemoteException,
InterruptedException
com.sun.jini.outrigger.OutriggerServertimeout parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie as response to the sub-queries, in
these cases it should pass the QueryCookie to the
next sub-query (if any) associated with the same request from
the client.
If a match is found it is returned as an EntryRep.
If txn is null the entry is removed
from the space. If txn is non-null the
entry is exclusively locked by the transaction and will be removed
from the space if the transaction is committed.
If no match is found the call will block for up to the
specified timeout for a match to appear. If there
is still no match available the call will return a
QueryCookie.
take in interface com.sun.jini.outrigger.OutriggerServertmpl - The template that describes the entry being
searched for. May be null if
any visible entry is acceptable.timeout - The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
null or a QueryCookie
(as appropriate) should be returned immediately.cookie - If this call is a continuation of
an earlier query, the cookie from the
last sub-query.
TransactionException - if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.
RemoteException - if a network failure occurs.
InterruptedException - if the thread in the server
is interrupted before the query can be completed.
public Object readIfExists(com.sun.jini.outrigger.EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
throws TransactionException,
RemoteException,
InterruptedException
com.sun.jini.outrigger.OutriggerServertimeout parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie as response to the sub-queries, in
these cases it should pass the QueryCookie to the
next sub-query (if any) associated with the same request from
the client.
If a match is found it is returned as an EntryRep.
If txn is non-null the
entry is read locked by the transaction, this allows
other queries to read, but not take the entry. The lock
will be released when the transaction is aborted or prepared.
If no match can be initially found the call will block until
either the timeout expires or for a detectable period of time
there are no entries in the space (visible to the transaction
or not) that match the passed template. If at some point
there are no matching entries in the space null
will be returned. If the timeout expires and there are matching
entries in the space but none are visible to the passed
transaction a QueryCookie will be returned.
readIfExists in interface com.sun.jini.outrigger.OutriggerServertmpl - The template that describes the entry being
searched for. May be null if
any visible entry is acceptable.timeout - The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
null or a QueryCookie
(as appropriate) should be returned immediately.cookie - If this call is a continuation of
an earlier query, the cookie from the
last sub-query.
RemoteException - if a network failure occurs.
TransactionException - if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.
InterruptedException - if the thread in the server
is interrupted before the query can be completed.
public Object takeIfExists(com.sun.jini.outrigger.EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
throws TransactionException,
RemoteException,
InterruptedException
com.sun.jini.outrigger.OutriggerServertimeout parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie as response to the sub-queries, in
these cases it should pass the QueryCookie to the
next sub-query (if any) associated with the same request from
the client.
If a match is found it is returned as an EntryRep.
If txn is null the entry is removed
from the space. If txn is non-null the
entry is exclusively locked by the transaction and will be removed
from the space if the transaction is committed.
If no match can be initially found the call will block until
either the timeout expires or for a detectable period of time
there are no entries in the space (visible to the transaction
or not) that match the passed template. If at some point there
are no matching entries in the space null will be
returned. If the timeout expires and there are matching entries
in the space but none are visible to the passed transaction a
QueryCookie will be returned.
takeIfExists in interface com.sun.jini.outrigger.OutriggerServertmpl - The template that describes the entry being
searched for. May be null if
any visible entry is acceptable.timeout - The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
null or a QueryCookie
(as appropriate) should be returned immediately.cookie - If this call is a continuation of
an earlier query, the cookie from the
last sub-query.
InterruptedException - if the thread in the server
is interrupted before the query can be completed.
TransactionException - if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.
RemoteException - if a network failure occurs.
public Object take(com.sun.jini.outrigger.EntryRep[] tmpls,
Transaction tr,
long timeout,
int limit,
OutriggerServer.QueryCookie queryCookieFromClient)
throws TransactionException,
RemoteException
com.sun.jini.outrigger.OutriggerServerlimit entries in the space
that match one or more of the passed templates and are visible
to the passed transaction. Depending on the state of the space
and the arguments this call may block if no entry can be
immediately returned. The proxy can specify the maximum period
it is willing to wait for a response using the
timeout parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie as response to the sub-queries, in
these cases it should pass the QueryCookie to the
next sub-query (if any) associated with the same request from
the client.
If matchs are found they are returned as in an array of
EntryRep. If txn is
null the entries are removed from the space. If
txn is non-null the entries are
exclusively locked by the transaction and will be removed from
the space if the transaction is committed.
If there are no matches the call will block for up to the
specified timeout for a match to appear. If there is still no
match available the call will return a
QueryCookie.
take in interface com.sun.jini.outrigger.OutriggerServertmpls - The templates that describes the entries being
searched fortr - The transaction the operation should be
performed under. Maybe be null.
If non-null and entries are found they
will removed under this transaction.timeout - The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
a QueryCookie should be
returned immediately.limit - The maximum number of entries that should be takenqueryCookieFromClient - If this call is a continuation of
an earlier query, the cookie from the
last sub-query.
RemoteException - if a network failure occurs.
TransactionException - if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.
public com.sun.jini.outrigger.MatchSetData contents(com.sun.jini.outrigger.EntryRep[] tmpls,
Transaction tr,
long leaseTime,
long limit)
throws TransactionException,
RemoteException
com.sun.jini.outrigger.OutriggerServerMatchSetData with the initial batch of
entries and (if applicable) the Uuid and initial
lease duration. If the entire result set is contained in the
returned MatchSetData the Uuid
will be null and the lease duration will be
-1.
contents in interface com.sun.jini.outrigger.OutriggerServertmpls - the templates to use for the iterationtr - the transaction to perform the iteration under,
may be nullleaseTime - the requested lease timelimit - the maximum number of entries to return
MatchSetData with the initial batch
of entries and (if applicable) the Uuid and initial
lease duration. Initial batch will be the empty array if
there are no matching entries in the space
TransactionException - if
tr is non-null and can't be used
RemoteException
public com.sun.jini.outrigger.EntryRep[] nextBatch(Uuid contentsQueryUuid,
Uuid entryUuid)
throws NoSuchObjectException
com.sun.jini.outrigger.OutriggerServer
nextBatch in interface com.sun.jini.outrigger.OutriggerServercontentsQueryUuid - the id of the contents queryentryUuid - the id of the last entry in the last batch.
If this does not match what the server has on recored
it will re-send the previous batch.
EntryReps representing
the next batch of entries from the query. Query
is complete if array is not full. Returns an empty
array if there are no entries left
NoSuchObjectExceptionpublic Object getServiceProxy()
ServiceProxyAccessornull.
getServiceProxy in interface ServiceProxyAccessorpublic Object getAdmin()
JavaSpaceAdmin
interface.
getAdmin in interface com.sun.jini.outrigger.OutriggerServerJavaSpaceAdminpublic JavaSpace space()
com.sun.jini.outrigger.OutriggerAdmin
space in interface com.sun.jini.outrigger.OutriggerAdmin
public Uuid contents(com.sun.jini.outrigger.EntryRep tmpl,
Transaction tr)
throws TransactionException,
RemoteException
com.sun.jini.outrigger.OutriggerAdminJavaSpaceAdmin.contents.
contents in interface com.sun.jini.outrigger.OutriggerAdminTransactionException
RemoteException
public com.sun.jini.outrigger.EntryRep[] nextReps(Uuid iterationUuid,
int max,
Uuid entryUuid)
throws NoSuchObjectException
com.sun.jini.outrigger.OutriggerAdminmax EntryRep objects from
the specified iteration.
nextReps in interface com.sun.jini.outrigger.OutriggerAdminiterationUuid - The Uuid of the iteration
to fetch entries from.max - Advice on the number of entries to returnentryUuid - Uuid of the last entry received by the
caller. If this does not match the ID of the last
entry sent by the iterator will re-send that last
batch in place of a new batch. May be
null in which case a new batch will be
sent. The first call to next() should
have id set to null
NoSuchObjectException
public void delete(Uuid iterationUuid,
Uuid entryUuid)
throws NoSuchObjectException
com.sun.jini.outrigger.OutriggerAdminnextReps.
delete in interface com.sun.jini.outrigger.OutriggerAdminiterationUuid - The Uuid of a valid
iteration.entryUuid - the Uuid of the entry
to be deleted.
NoSuchObjectException
public void close(Uuid iterationUuid)
throws NoSuchObjectException
com.sun.jini.outrigger.OutriggerAdmin
close in interface com.sun.jini.outrigger.OutriggerAdminiterationUuid - The Uuid iteration to close.
NoSuchObjectExceptionpublic void destroy()
destroy in interface DestroyAdminpublic Entry[] getLookupAttributes()
JoinAdmin
getLookupAttributes in interface JoinAdminpublic void addLookupAttributes(Entry[] attrSets)
JoinAdmin
addLookupAttributes in interface JoinAdminattrSets - the attribute sets to add
public void modifyLookupAttributes(Entry[] attrSetTemplates,
Entry[] attrSets)
JoinAdmin
modifyLookupAttributes in interface JoinAdminattrSetTemplates - the templates for matching attribute setsattrSets - the modifications to make to matching setsServiceRegistration.modifyAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[])public String[] getLookupGroups()
JoinAdmin
getLookupGroups in interface JoinAdminJoinAdmin.setLookupGroups(java.lang.String[])public void addLookupGroups(String[] groups)
JoinAdmin
addLookupGroups in interface JoinAdmingroups - groups to joinJoinAdmin.removeLookupGroups(java.lang.String[])public void removeLookupGroups(String[] groups)
JoinAdmin
removeLookupGroups in interface JoinAdmingroups - groups to leaveJoinAdmin.addLookupGroups(java.lang.String[])public void setLookupGroups(String[] groups)
JoinAdmin
setLookupGroups in interface JoinAdmingroups - groups to joinJoinAdmin.getLookupGroups()public LookupLocator[] getLookupLocators()
JoinAdmin
getLookupLocators in interface JoinAdminJoinAdmin.setLookupLocators(net.jini.core.discovery.LookupLocator[])
public void addLookupLocators(LookupLocator[] locators)
throws RemoteException
JoinAdmin
addLookupLocators in interface JoinAdminlocators - locators of specific lookup services to join
RemoteExceptionJoinAdmin.removeLookupLocators(net.jini.core.discovery.LookupLocator[])
public void removeLookupLocators(LookupLocator[] locators)
throws RemoteException
JoinAdmin
removeLookupLocators in interface JoinAdminlocators - locators of specific lookup services to leave
RemoteExceptionJoinAdmin.addLookupLocators(net.jini.core.discovery.LookupLocator[])
public void setLookupLocators(LookupLocator[] locators)
throws RemoteException
JoinAdmin
setLookupLocators in interface JoinAdminlocators - locators of specific lookup services to join
RemoteExceptionJoinAdmin.getLookupLocators()public void recoverSessionId(long sessionId)
recoverSessionId in interface RecoversessionId - Value used by the previous invocation of OutriggerLogOps.bootOp(long, long)
public void recoverJoinState(StoredObject state)
throws Exception
Recover
recoverJoinState in interface Recoverstate - is the stored join state
ExceptionLogOps.joinStateOp(com.sun.jini.outrigger.StorableObject)
public void recoverWrite(StoredResource entry,
Long txnId)
throws Exception
Recoverentry is the
stored form of the entry passed into writeOp. If the
original write was done under a transaction, and the transaction
was prepared txnId will be non-null.
recoverWrite in interface Recoverentry - stored from of the written entrytxnId - transaction identifier or null
Exception - is thrown if any error occurs recovering the
writeLogOps.writeOp(com.sun.jini.outrigger.StorableResource, java.lang.Long)
public void recoverTake(Uuid cookie,
Long txnId)
throws Exception
RecovertxnId
will be non-null.
recoverTake in interface Recovercookie - identifier of the entry to taketxnId - transaction identifier or null
Exception - is thrown if any error occurs recovering the takeLogOps.takeOp(net.jini.id.Uuid, java.lang.Long)
public void recoverTransaction(Long txnId,
StoredObject transaction)
throws Exception
Recovertransaction is the stored form of the transaction
passed into prepareOp.
recoverTransaction in interface RecovertxnId - transaction identifiertransaction - stored from of the prepared transaction
Exception - is thrown if any error occurs recovering the
transactionLogOps.prepareOp(java.lang.Long, com.sun.jini.outrigger.StorableObject)
public void recoverRegister(StoredResource registration,
String type,
StoredObject[] storedTemplates)
throws Exception
Recoverregistration is the stored form of the
registration passed into registerOp. The recovered
template is the stored form of the template.
recoverRegister in interface Recoverregistration - stored from of the logged registrationtype - of registration, same value that was passed into
corresponding registerOp callstoredTemplates - stored from of the logged templates
Exception - is thrown if any error occurs recovering the
registrationLogOps.registerOp(com.sun.jini.outrigger.StorableResource, java.lang.String, com.sun.jini.outrigger.StorableObject[])public void recoverUuid(Uuid uuid)
RecoverUuid for the service as a whole.
Will only be called if a Uuid has be stored during
a previous incarnation.
recoverUuid in interface Recoveruuid - The Uuid being recovered.LogOps.uuidOp(net.jini.id.Uuid)public TrustVerifier getProxyVerifier()
ServerProxyTrustTrustVerifier that can be used to verify that
a proxy can be trusted as a proxy for the service; that is, the
isTrustedObject method of the
returned verifier can be called with a candidate proxy. The verifier
should be able to verify all proxies for the service, including
proxies for resources (such as leases and registrations).
getProxyVerifier in interface ServerProxyTrustTrustVerifier that can be used to verify that
a proxy can be trusted as a proxy for the service
public int prepare(TransactionManager mgr,
long id)
throws UnknownTransactionException,
UnmarshalException
TransactionParticipantPREPARED, indicating that it is prepared;
ABORT, indicating that it will abort, or
NOTCHANGED, indicating that it did not have any state
changed by the transaction (i.e., it was read-only). If the response
is PREPARED, the participant must wait until it receives
a commit or abort call from the transaction manager; it may query the
transaction manager if needed as to the state of the transaction. If
the response is ABORT, the participant should roll its
state back to undo any changes that occurred due to operations
performed under the transaction; it can then discard any information
about the transaction. If the response is NOTCHANGED, the
participant can immediately discard any knowledge of the transaction.
prepare in interface TransactionParticipantmgr - the manager of the transactionid - the transaction ID
int representing this participant's state
UnknownTransactionException - if the transaction
is unknown to the transaction manager, either
because the transaction ID is incorrect or because the
transaction is complete and its state has been
discarded by the manager.
UnmarshalException
public void commit(TransactionManager mgr,
long id)
throws UnknownTransactionException,
UnmarshalException
TransactionParticipantPREPARED
changes for the specified transaction visible outside of the
transaction and unlock any resources locked by the transaction.
All state associated with the transaction can then be discarded
by the participant.
commit in interface TransactionParticipantmgr - the manager of the transactionid - the transaction ID
UnknownTransactionException - if the transaction
is unknown to the transaction manager, either
because the transaction ID is incorrect or because the
transaction is complete and its state has been
discarded by the manager.
UnmarshalException
public void abort(TransactionManager mgr,
long id)
throws UnknownTransactionException,
UnmarshalException
TransactionParticipant
abort in interface TransactionParticipantmgr - the manager of the transactionid - the transaction ID
UnknownTransactionException - if the transaction
is unknown to the transaction manager, either
because the transaction ID is incorrect or because the
transaction is complete and its state has been
discarded by the manager.
UnmarshalException
public int prepareAndCommit(TransactionManager mgr,
long id)
throws UnknownTransactionException,
UnmarshalException
TransactionParticipantprepare and commit, which
can be used by the manager when there is just one participant left to
prepare and all other participants (if any) have responded with
NOTCHANGED. The participant's implementation of this
method must be equivalent to:
public int prepareAndCommit(TransactionManager mgr, long id)
throws UnknownTransactionException, RemoteException
{
int result = prepare(mgr, id);
if (result == PREPARED) {
commit(mgr, id);
result = COMMITTED;
}
return result;
}
prepareAndCommit in interface TransactionParticipantmgr - the manager of the transactionid - the transaction ID
int representing its state
UnknownTransactionException - if the transaction
is unknown to the transaction manager, either
because the transaction ID is incorrect or because the
transaction is complete and its state has been
discarded by the manager.
UnmarshalExceptionTransactionParticipant.prepare(net.jini.core.transaction.server.TransactionManager, long),
TransactionParticipant.commit(net.jini.core.transaction.server.TransactionManager, long)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||