org.osgi.service.remoteserviceadmin.EndpointEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of osgi.cmpn Show documentation
Show all versions of osgi.cmpn Show documentation
OSGi Compendium Release 7, Interfaces and Classes for use in compiling bundles
/*
* Copyright (c) OSGi Alliance (2013). 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.remoteserviceadmin;
/**
* An Endpoint Event.
*
*
* {@code EndpointEvent} objects are delivered to all registered
* {@link EndpointEventListener} services where the {@link EndpointDescription}
* properties match one of the filters specified in the
* {@link EndpointEventListener#ENDPOINT_LISTENER_SCOPE} registration properties
* of the Endpoint Event Listener.
*
*
* A type code is used to identify the type of event. The following event types
* are defined:
*
* - {@link #ADDED}
* - {@link #REMOVED}
* - {@link #MODIFIED}
* - {@link #MODIFIED_ENDMATCH}
*
* Additional event types may be defined in the future.
*
*
* @see EndpointEventListener
* @Immutable
* @since 1.1
*/
public class EndpointEvent {
/**
* An endpoint has been added.
*
*
* This {@code EndpointEvent} type indicates that a new endpoint has been
* added. The endpoint is represented by the associated
* {@link EndpointDescription} object.
*/
public static final int ADDED = 0x00000001;
/**
* An endpoint has been removed.
*
*
* This {@code EndpointEvent} type indicates that an endpoint has been
* removed. The endpoint is represented by the associated
* {@link EndpointDescription} object.
*/
public static final int REMOVED = 0x00000002;
/**
* The properties of an endpoint have been modified.
*
*
* This {@code EndpointEvent} type indicates that the properties of an
* existing endpoint have been modified. The endpoint is represented by the
* associated {@link EndpointDescription} object and its properties can be
* obtained via {@link EndpointDescription#getProperties()}. The endpoint
* properties still match the filters as specified in the
* {@link EndpointEventListener#ENDPOINT_LISTENER_SCOPE} filter.
*/
public static final int MODIFIED = 0x00000004;
/**
* The properties of an endpoint have been modified and the new properties
* no longer match the listener's filter.
*
*
* This {@code EndpointEvent} type indicates that the properties of an
* existing endpoint have been modified and no longer match the filter. The
* endpoint is represented by the associated {@link EndpointDescription}
* object and its properties can be obtained via
* {@link EndpointDescription#getProperties()}. As a consequence of the
* modification the filters as specified in the
* {@link EndpointEventListener#ENDPOINT_LISTENER_SCOPE} do not match any
* more.
*/
public static final int MODIFIED_ENDMATCH = 0x00000008;
/**
* Reference to the associated endpoint description.
*/
private final EndpointDescription endpoint;
/**
* Type of the event.
*/
private final int type;
/**
* Constructs a {@code EndpointEvent} object from the given arguments.
*
* @param type The event type. See {@link #getType()}.
* @param endpoint The endpoint associated with the event.
*/
public EndpointEvent(int type, EndpointDescription endpoint) {
this.endpoint = endpoint;
this.type = type;
}
/**
* Return the endpoint associated with this event.
*
* @return The endpoint associated with the event.
*/
public EndpointDescription getEndpoint() {
return endpoint;
}
/**
* Return the type of this event.
*
* The type values are:
*
* - {@link #ADDED}
* - {@link #REMOVED}
* - {@link #MODIFIED}
* - {@link #MODIFIED_ENDMATCH}
*
*
* @return The type of this event.
*/
public int getType() {
return type;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy