/* * $Header: /cvshome/build/org.osgi.service.wireadmin/src/org/osgi/service/wireadmin/WireAdminListener.java,v 1.9 2006/06/16 16:31:43 hargrave Exp $ * * Copyright (c) OSGi Alliance (2002, 2006). All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.osgi.service.wireadmin; /** * Listener for Wire Admin Events. * *
* WireAdminListener objects are registered with the Framework
* service registry and are notified with a WireAdminEvent object
* when an event is broadcast.
*
* WireAdminListener objects can inspect the received
* WireAdminEvent object to determine its type, the Wire
* object with which it is associated, and the Wire Admin service that
* broadcasts the event.
*
*
* WireAdminListener objects must be registered with a service
* property {@link WireConstants#WIREADMIN_EVENTS}whose value is a bitwise OR
* of all the event 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
WireAdminListener object is registered without a service
* property {@link WireConstants#WIREADMIN_EVENTS}, then the
* WireAdminListener will receive no events.
*
*
* Security Considerations. Bundles wishing to monitor WireAdminEvent
* objects will require ServicePermission[WireAdminListener,REGISTER]
* to register a WireAdminListener service. Since
* WireAdminEvent objects contain Wire objects, care must
* be taken in assigning permission to register a WireAdminListener
* service.
*
* @see WireAdminEvent
*
* @version $Revision: 1.9 $
*/
public interface WireAdminListener {
/**
* Receives notification of a broadcast WireAdminEvent object.
*
* The event object will be of an event type specified in this
* WireAdminListener service's
* {@link WireConstants#WIREADMIN_EVENTS}service property.
*
* @param event The WireAdminEvent object.
*/
void wireAdminEvent(WireAdminEvent event);
}