|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ow2.jonas.jaxrs.jersey.internal.JerseyApplicationPublisher
public class JerseyApplicationPublisher
The JerseyApplicationPublisher is responsible of publishing
JAX-RS Application registered in the OSGi service registry
onto the HttpService.
Without any configuration (and any dependency on a JAX-RS implementation),
a client can easily expose his Application with the following code:
bundleContext.registerService(Application.class, new MyApplication(), null);
This RESTful application will be available under the following path: /{bundle-symbolic-name}/{bundle-version}.
Name collision could happen if the same Bundle provides more than
1 Application.
To avoid collisions, the client should provide a unique value into the
jonas.jaxrs.context-path service property when registering his services.
Properties sp = new Properties();
sp.setProperty("jonas.jaxrs.context-path", "/my-app");
bundleContext.registerService(Application.class, new MyApplication(), sp);
O
Notice that @ApplicationPath (if provided) will be respected
(appended to the context path).
| Field Summary | |
|---|---|
static String |
CONTEXT_PROPERTY
Optional service property that defines the web context name of the REST application. |
| Constructor Summary | |
|---|---|
JerseyApplicationPublisher()
|
|
| Method Summary | |
|---|---|
void |
bindApplication(javax.ws.rs.core.Application application,
org.osgi.framework.ServiceReference reference)
Manage a newly registered Application service. |
void |
setHttpService(org.osgi.service.http.HttpService httpService)
Bind the required OSGi HTTP Service. |
void |
stop()
Stop the publisher, un-registering all managed REST applications. |
void |
unbindApplication(org.osgi.framework.ServiceReference reference)
Un-manage the given Application. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CONTEXT_PROPERTY
| Constructor Detail |
|---|
public JerseyApplicationPublisher()
| Method Detail |
|---|
public void setHttpService(org.osgi.service.http.HttpService httpService)
httpService - required servicepublic void stop()
public void bindApplication(javax.ws.rs.core.Application application,
org.osgi.framework.ServiceReference reference)
Application service.
application - REST applicationreference - the associated ServiceReference.public void unbindApplication(org.osgi.framework.ServiceReference reference)
reference - reference of the Application service.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||