Interface WireAdmin
-
public interface WireAdminWire Administration service.This service can be used to create
Wireobjects connecting a Producer service and a Consumer service.Wireobjects also have wire properties that may be specified when aWireobject is created. The Producer and Consumer services may use theWireobject's properties to manage or control their interaction. The use ofWireobject's properties by a Producer or Consumer services is optional.Security Considerations. A bundle must have
ServicePermission[WireAdmin,GET]to get the Wire Admin service to create, modify, find, and deleteWireobjects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WirecreateWire(java.lang.String producerPID, java.lang.String consumerPID, java.util.Dictionary<java.lang.String,?> properties)Create a newWireobject that connects a Producer service to a Consumer service.voiddeleteWire(Wire wire)Delete aWireobject.Wire[]getWires(java.lang.String filter)Return theWireobjects that match the givenfilter.voidupdateWire(Wire wire, java.util.Dictionary<java.lang.String,?> properties)Update the properties of aWireobject.
-
-
-
Method Detail
-
createWire
Wire createWire(java.lang.String producerPID, java.lang.String consumerPID, java.util.Dictionary<java.lang.String,?> properties)
Create a newWireobject that connects a Producer service to a Consumer service. The Producer service and Consumer service do not have to be registered when theWireobject is created.The
Wireconfiguration data must be persistently stored. AllWireconnections are reestablished when theWireAdminservice is registered. AWirecan be permanently removed by using thedeleteWire(Wire)method.The
Wireobject's properties must have case insensitiveStringobjects as keys (like the Framework). However, the case of the key must be preserved.The
WireAdminservice must automatically add the followingWireproperties:WireConstants.WIREADMIN_PIDset to the value of theWireobject's persistent identity (PID). This value is generated by the Wire Admin service when aWireobject is created.WireConstants.WIREADMIN_PRODUCER_PIDset to the value of Producer service's PID.WireConstants.WIREADMIN_CONSUMER_PIDset to the value of Consumer service's PID.
propertiesargument already contains any of these keys, then the supplied values are replaced with the values assigned by the Wire Admin service.The Wire Admin service must broadcast a
WireAdminEventof typeWireAdminEvent.WIRE_CREATEDafter the newWireobject becomes available fromgetWires(String).- Parameters:
producerPID- Theservice.pidof the Producer service to be connected to theWireobject.consumerPID- Theservice.pidof the Consumer service to be connected to theWireobject.properties- TheWireobject's properties. This argument may benullif the caller does not wish to define anyWireobject's properties.- Returns:
- The
Wireobject for this connection. - Throws:
java.lang.IllegalArgumentException- Ifpropertiescontains invalid wire types or case variants of the same key name.
-
deleteWire
void deleteWire(Wire wire)
Delete aWireobject.The
Wireobject representing a connection between a Producer service and a Consumer service must be removed. The persistently stored configuration data for theWireobject must destroyed. TheWireobject's methodWire.isValid()will returnfalseafter it is deleted.The Wire Admin service must broadcast a
WireAdminEventof typeWireAdminEvent.WIRE_DELETEDafter theWireobject becomes invalid.- Parameters:
wire- TheWireobject which is to be deleted.
-
updateWire
void updateWire(Wire wire, java.util.Dictionary<java.lang.String,?> properties)
Update the properties of aWireobject. The persistently stored configuration data for theWireobject is updated with the new properties and then the Consumer and Producer services will be called at the respectiveConsumer.producersConnected(Wire[])andProducer.consumersConnected(Wire[])methods.The Wire Admin service must broadcast a
WireAdminEventof typeWireAdminEvent.WIRE_UPDATEDafter the updated properties are available from theWireobject.- Parameters:
wire- TheWireobject which is to be updated.properties- The newWireobject's properties ornullif no properties are required.- Throws:
java.lang.IllegalArgumentException- Ifpropertiescontains invalid wire types or case variants of the same key name.
-
getWires
Wire[] getWires(java.lang.String filter) throws org.osgi.framework.InvalidSyntaxException
Return theWireobjects that match the givenfilter.The list of available
Wireobjects is matched against the specifiedfilter.Wireobjects which match thefiltermust be returned. TheseWireobjects are not necessarily connected. The Wire Admin service should not return invalidWireobjects, but it is possible that aWireobject is deleted after it was placed in the list.The filter matches against the
Wireobject's properties includingWireConstants.WIREADMIN_PRODUCER_PID,WireConstants.WIREADMIN_CONSUMER_PIDandWireConstants.WIREADMIN_PID.- Parameters:
filter- Filter string to selectWireobjects ornullto select allWireobjects.- Returns:
- An array of
Wireobjects which match thefilterornullif noWireobjects match thefilter. - Throws:
org.osgi.framework.InvalidSyntaxException- If the specifiedfilterhas an invalid syntax.- See Also:
Filter
-
-