final class ConstrainableParticipantProxy extends ParticipantProxy implements RemoteMethodControl
ParticipantProxy that implements
RemoteMethodControl| Modifier and Type | Field and Description |
|---|---|
private static long |
serialVersionUID |
space, spaceUuidABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING| Constructor and Description |
|---|
ConstrainableParticipantProxy(TransactionParticipant space,
Uuid spaceUuid,
MethodConstraints methodConstraints)
Create a new
ConstrainableParticipantProxy for the given
space. |
| Modifier and Type | Method and Description |
|---|---|
private static TransactionParticipant |
constrainServer(TransactionParticipant participant,
MethodConstraints methodConstraints)
Returns a copy of the server proxy with the specified client
constraints and methods mapping.
|
MethodConstraints |
getConstraints()
Returns the client constraints placed on this proxy.
|
private ProxyTrustIterator |
getProxyTrustIterator()
Returns a proxy trust iterator that is used in
ProxyTrustVerifier to retrieve this object's
trust verifier. |
private void |
readObject(ObjectInputStream s) |
RemoteMethodControl |
setConstraints(MethodConstraints constraints)
Returns a new copy of this proxy with the client constraints set to the
specified constraints.
|
abort, commit, equals, getReferentUuid, hashCode, prepare, prepareAndCommit, toStringprivate static final long serialVersionUID
ConstrainableParticipantProxy(TransactionParticipant space, Uuid spaceUuid, MethodConstraints methodConstraints)
ConstrainableParticipantProxy for the given
space.space - The an inner proxy that implements
TransactionParticipant for the
space.spaceUuid - The universally unique ID for the
spaceNullPointerException - if space or
spaceUuid is null.private static TransactionParticipant constrainServer(TransactionParticipant participant, MethodConstraints methodConstraints)
public RemoteMethodControl setConstraints(MethodConstraints constraints)
RemoteMethodControlgetConstraints method of the copy returns
the identical constraints instance. The original proxy is not modified.
A null value is interpreted as mapping all methods to
empty constraints (one that has no requirements and no preferences).
For any given remote call, the specific client requirements and
preferences to be satisfied are given by the return value of invoking
the getConstraints method of
the specified MethodConstraints instance with a
Method object representing the remote method.
Client constraints placed on a proxy are included in the serialized
state of the proxy. This allows third-party services to be transparent
to the client's needs. For example, if remote object s1
obtains a proxy for remote object s2, and passes that
proxy to remote object s3, expecting s3 to
invoke a remote method on s2, then s1 can
control that call by placing its constraints directly on the proxy
before passing it to s3. If s3 does not
wish to be transparent in this way, then it should explicitly replace
the client constraints on received proxies with whatever constraints
are appropriate to implement its own policy.
setConstraints in interface RemoteMethodControlconstraints - client constraints, or nullRemoteMethodControl.getConstraints()public MethodConstraints getConstraints()
RemoteMethodControlnull, which is interpreted as mapping all
methods to empty constraints (one that has no requirements and no
preferences).getConstraints in interface RemoteMethodControlnullRemoteMethodControl.setConstraints(net.jini.core.constraint.MethodConstraints)private ProxyTrustIterator getProxyTrustIterator()
ProxyTrustVerifier to retrieve this object's
trust verifier.private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.