|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.tcp.StaticResourcesAdapter
com.sun.grizzly.tcp.http11.GrizzlyAdapter
com.sun.grizzly.osgi.httpservice.OSGiMainAdapter
public class OSGiMainAdapter
OSGi Main Adapter.
Dispatching adapter. Grizzly integration. Responsibilities:GrizzlyAdapter.service(GrizzlyRequest, GrizzlyResponse)
method call to registered
GrizzlyAdapter
s.
Field Summary |
---|
Fields inherited from class com.sun.grizzly.tcp.http11.GrizzlyAdapter |
---|
ADAPTER_NOTES, ALLOW_BACKSLASH, chunkingDisabled |
Fields inherited from class com.sun.grizzly.tcp.StaticResourcesAdapter |
---|
cache, commitErrorResponse, fileFolders, resourcesContextPath |
Constructor Summary | |
---|---|
OSGiMainAdapter(Logger logger,
org.osgi.framework.Bundle bundle)
Constructor. |
Method Summary | |
---|---|
ReentrantReadWriteLock.ReadLock |
getProcessingLock()
Processing lock. |
ReentrantReadWriteLock.WriteLock |
getRemovalLock()
Removal lock. |
void |
registerResourceAdapter(String alias,
org.osgi.service.http.HttpContext context,
String internalPrefix,
org.osgi.service.http.HttpService httpService)
Registers OSGiResourceAdapter in OSGi Http Service. |
void |
registerServletAdapter(String alias,
Servlet servlet,
Dictionary initparams,
org.osgi.service.http.HttpContext context,
org.osgi.service.http.HttpService httpService)
Registers OSGiServletAdapter in OSGi Http Service. |
void |
service(GrizzlyRequest request,
GrizzlyResponse response)
Service method dispatching to registered handlers. |
void |
unregisterAlias(String alias)
Unregisters previously registered alias. |
void |
unregisterAll()
Part of Shutdown sequence. |
void |
uregisterAllLocal()
Unregisters all alias es registered by owning bundle. |
Methods inherited from class com.sun.grizzly.tcp.http11.GrizzlyAdapter |
---|
afterService, afterService, destroy, isAllowEncodedSlash, isDecodeURL, isHandleStaticResources, service, setAllowEncodedSlash, setDecodeUrl, setHandleStaticResources, start |
Methods inherited from class com.sun.grizzly.tcp.StaticResourcesAdapter |
---|
addRootFolder, customizedErrorPage, getDefaultContentType, getResourcesContextPath, getRootFolder, getRootFolders, initWebDir, isUseSendFile, service, setDefaultContentType, setLogger, setResourcesContextPath, setRootFolder, setUseSendFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OSGiMainAdapter(Logger logger, org.osgi.framework.Bundle bundle)
logger
- Logger utility.bundle
- Bundle that we create if for, for local data reference.Method Detail |
---|
public void service(GrizzlyRequest request, GrizzlyResponse response) throws Exception
service
in class GrizzlyAdapter
request
- The GrizzlyRequest
response
- The GrizzlyResponse
Exception
public void registerServletAdapter(String alias, Servlet servlet, Dictionary initparams, org.osgi.service.http.HttpContext context, org.osgi.service.http.HttpService httpService) throws org.osgi.service.http.NamespaceException, ServletException
OSGiServletAdapter
in OSGi Http Service.
Keeps truck of all registrations, takes care of thread safety.
alias
- Alias to register, if wrong value than throws NamespaceException
.servlet
- Servlet to register under alias, if fails to Servlet.init(javax.servlet.ServletConfig)
throws ServletException
.initparams
- Initial parameters to populate ServletContext
with.context
- OSGi HttpContext
, provides mime handling, security and bundle specific resource access.httpService
- Used to HttpService.createDefaultHttpContext()
if needed.
org.osgi.service.http.NamespaceException
- If alias was invalid or already registered.
ServletException
- If Servlet.init(javax.servlet.ServletConfig)
fails.public void registerResourceAdapter(String alias, org.osgi.service.http.HttpContext context, String internalPrefix, org.osgi.service.http.HttpService httpService) throws org.osgi.service.http.NamespaceException
OSGiResourceAdapter
in OSGi Http Service.
Keeps truck of all registrations, takes care of thread safety.
alias
- Alias to register, if wrong value than throws NamespaceException
.context
- OSGi HttpContext
, provides mime handling, security and bundle specific resource access.internalPrefix
- Prefix to map request for this alias to.httpService
- Used to HttpService.createDefaultHttpContext()
if needed.
org.osgi.service.http.NamespaceException
- If alias was invalid or already registered.public void unregisterAlias(String alias)
alias
- Alias to unregister, if not owning alias IllegalArgumentException
is thrown.
IllegalArgumentException
- If alias was not registered by calling bundle.public void uregisterAllLocal()
alias
es registered by owning bundle.
public void unregisterAll()
public ReentrantReadWriteLock.ReadLock getProcessingLock()
ReentrantReadWriteLock.ReadLock
can be obtained by concurrent threads at the same time.
getProcessingLock
in interface OSGiGrizzlyAdapter
public ReentrantReadWriteLock.WriteLock getRemovalLock()
ReentrantReadWriteLock.WriteLock
can be obtained only by one thread, blocks OSGiGrizzlyAdapter.getProcessingLock()
.
getRemovalLock
in interface OSGiGrizzlyAdapter
OSGiGrizzlyAdapter.getProcessingLock()
,
ReentrantReadWriteLock.WriteLock
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |