public abstract class SipApplicationRouterProvider extends Object
META-INF/services/javax.servlet.sip.ar.spi.SipApplicationRouterProvider
file. The contents of the file indicate the name of the concrete public subclass
of the SipApplicationRouterProvider class.
The concrete subclass must have a no-arg public constructor.
public class AcmeAppRouter implements SipApplicationRouter {
[...]
}
public class AcmeAppRouterProvider extends SipApplicationRouterProvider {
private final AcmeAppRouter appRouter = new AcmeAppRouter();
public AcmeAppRouterProvider() {
}
public SipApplicationRouter getSipApplicationRouter() {
return appRouter;
}
}
The AcmeAppRouter is then packaged in a jar file and prepended to
the system class path. The SIP servlet container can look up the application
router in a manner outlined below.
SipApplicationRouter getSipApplicationRouter() {
Iterator ps = Service.providers(SipApplicationRouterProvider.class);
while (ps.hasNext()) {
SipApplicationRouterProvider p = (SipApplicationRouterProvider)ps.next();
return p.getSipApplicationRouter();
}
return null;
}
Since the SIP servlet specification allows for only one application router to be
active at any given time, the container selects the first provider
available in the system classpath. javax.servlet.sip.ar.spi.SipApplicationRouterProvider
system property can be used to override loading behavior and force a specific
provider implementation to be used. For portability reasons, containers
that provide their own deployment mechanism for the application router SHOULD
obey the system property, if specified by the deployer.| Constructor and Description |
|---|
SipApplicationRouterProvider() |
| Modifier and Type | Method and Description |
|---|---|
abstract SipApplicationRouter |
getSipApplicationRouter()
Retrieve an instance of the application router created by
this provider
|
public abstract SipApplicationRouter getSipApplicationRouter()
Copyright © 1996-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.