All Downloads are FREE. Search and download functionalities are using the official Maven repository.

osgi.enroute.eventadminserversentevents.capabilities.RequireEventAdminServerSentEventsWebResource Maven / Gradle / Ivy

Go to download

Provides a mapping from Event Admin events to Javascript Server Side Events (SSE). This bundle registers under /sse/1, the remaining path is treated as the topic. It will then send all matching events to the browser through SSE. The type of the event is org.osgi.service.eventadmin;topic=%s, the data payload is a JSON representation of the event properties.

The newest version!
package osgi.enroute.eventadminserversentevents.capabilities;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import org.osgi.annotation.bundle.Requirement;

import osgi.enroute.namespace.WebResourceNamespace;

/**
 * A Web Resource that provides Easse javascript files.
 */
@Requirement(namespace = WebResourceNamespace.NS, filter = "(&(" + WebResourceNamespace.NS + "="
	+ EventAdminServerSentEventsConstants.EVENT_ADMIN_SERVER_SENT_EVENTS_WEB_RESOURCE_PATH + ")(version>="
	+ EventAdminServerSentEventsConstants.EVENT_ADMIN_SERVER_SENT_EVENTS_WEB_RESOURCE_VERSION + "))")
@Retention(RetentionPolicy.CLASS)
public @interface RequireEventAdminServerSentEventsWebResource {

	/**
	 * Define the default resource to return
	 *
	 * @return the list of resources to include
	 */
	String[] resource() default {
		"easse.js", "polyfill/eventsource.js"
	};

	/**
	 * Define the priority of this web resources. The higher the priority, the
	 * earlier it is loaded when all web resources are combined.
	 *
	 * @return the priority
	 */
	int priority() default 100;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy