Package org.osgi.service.wireadmin
Interface Envelope
-
- All Known Implementing Classes:
BasicEnvelope
public interface EnvelopeIdentifies a contained value. AnEnvelopeobject combines a status value, an identification object and a scope name. TheEnvelopeobject allows the use of standard Java types when a Producer service can produce more than one kind of object. TheEnvelopeobject allows the Consumer service to recognize the kind of object that is received. For example, a door lock could be represented by aBooleanobject. If theProducerservice would send such aBooleanobject, then the Consumer service would not know what door theBooleanobject represented. TheEnvelopeobject contains an identification object so the Consumer service can discriminate between different kinds of values. The identification object may be a simpleStringobject, but it can also be a domain specific object that is mutually agreed by the Producer and the Consumer service. This object can then contain relevant information that makes the identification easier.The scope name of the envelope is used for security. The Wire object must verify that any
Envelopeobject send through theupdatemethod or coming from thepollmethod has a scope name that matches the permissions of both the Producer service and the Consumer service involved. The wireadmin package also contains a classBasicEnvelopethat implements the methods of this interface.- See Also:
WirePermission,BasicEnvelope
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetIdentification()Return the identification of thisEnvelopeobject.java.lang.StringgetScope()Return the scope name of thisEnvelopeobject.java.lang.ObjectgetValue()Return the value associated with thisEnvelopeobject.
-
-
-
Method Detail
-
getValue
java.lang.Object getValue()
Return the value associated with thisEnvelopeobject.- Returns:
- the value of the status item, or
nullwhen no item is associated with this object.
-
getIdentification
java.lang.Object getIdentification()
Return the identification of thisEnvelopeobject. An identification may be of any Java type. The type must be mutually agreed between the Consumer and Producer services.- Returns:
- an object which identifies the status item in the address space of the composite producer, must not be null.
-
getScope
java.lang.String getScope()
Return the scope name of thisEnvelopeobject. Scope names are used to restrict the communication between the Producer and Consumer services. OnlyEnvelopesobjects with a scope name that is permitted for the Producer and the Consumer services must be passed through aWireobject.- Returns:
- the security scope for the status item, must not be null.
-
-