{@code WireAdminListener} objects are registered with the Framework serviceregistry and are notified with a {@code WireAdminEvent} object when an eventis broadcast.
{@code WireAdminListener} objects can inspect the received{@code WireAdminEvent} object to determine its type, the {@code Wire} objectwith which it is associated, and the Wire Admin service that broadcasts the event.
{@code WireAdminListener} objects must be registered with a service property{@link WireConstants#WIREADMIN_EVENTS} whose value is a bitwise OR of all theevent types the listener is interested in receiving.
For example:
Integer mask = new Integer(WIRE_TRACE | WIRE_CONNECTED | WIRE_DISCONNECTED); Hashtable ht = new Hashtable(); ht.put(WIREADMIN_EVENTS, mask); context.registerService(WireAdminListener.class.getName(), this, ht);If a {@code WireAdminListener} object is registered without a serviceproperty {@link WireConstants#WIREADMIN_EVENTS}, then the {@code WireAdminListener} will receive no events.
Security Considerations. Bundles wishing to monitor {@code WireAdminEvent}objects will require {@code ServicePermission[WireAdminListener,REGISTER]} toregister a {@code WireAdminListener} service. Since {@code WireAdminEvent}objects contain {@code Wire} objects, care must be taken in assigningpermission to register a {@code WireAdminListener} service. @see WireAdminEvent @author $Id: 0a0f329f66848f4808f16b57f855dfb54d2bbb7f $
|
|