com.sun.grizzly.osgi.httpservice
Class OSGiResourceAdapter

java.lang.Object
  extended by com.sun.grizzly.tcp.StaticResourcesAdapter
      extended by com.sun.grizzly.tcp.http11.GrizzlyAdapter
          extended by com.sun.grizzly.osgi.httpservice.OSGiResourceAdapter
All Implemented Interfaces:
OSGiGrizzlyAdapter, Adapter

public class OSGiResourceAdapter
extends GrizzlyAdapter
implements OSGiGrizzlyAdapter

OSGi Resource Adapter.

OSGi Resource registration integration.

Author:
Hubert Iwaniuk

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
OSGiResourceAdapter(String alias, String prefix, org.osgi.service.http.HttpContext httpContext, Logger logger)
          Default constructor.
 
Method Summary
 ReentrantReadWriteLock.ReadLock getProcessingLock()
          Processing lock.
 ReentrantReadWriteLock.WriteLock getRemovalLock()
          Removal lock.
 void service(GrizzlyRequest request, GrizzlyResponse response)
          This method should contains the logic for any http extension to the Grizzly HTTP Webserver.
 
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

OSGiResourceAdapter

public OSGiResourceAdapter(String alias,
                           String prefix,
                           org.osgi.service.http.HttpContext httpContext,
                           Logger logger)
Default constructor.

Parameters:
alias - Registered under this alias.
prefix - Internal prefix.
httpContext - Backing HttpContext.
logger - Logger utility.
Method Detail

service

public void service(GrizzlyRequest request,
                    GrizzlyResponse response)
This method should contains the logic for any http extension to the Grizzly HTTP Webserver.

Specified by:
service in class GrizzlyAdapter
Parameters:
request - The GrizzlyRequest
response - The GrizzlyResponse

getProcessingLock

public ReentrantReadWriteLock.ReadLock getProcessingLock()
Processing lock.

ReentrantReadWriteLock.ReadLock can be obtained by concurrent threads at the same time.

Specified by:
getProcessingLock in interface OSGiGrizzlyAdapter
Returns:
Processing lock.

getRemovalLock

public ReentrantReadWriteLock.WriteLock getRemovalLock()
Removal lock.

ReentrantReadWriteLock.WriteLock can be obtained only by one thread, blocks OSGiGrizzlyAdapter.getProcessingLock().

Specified by:
getRemovalLock in interface OSGiGrizzlyAdapter
Returns:
Removal lock.
See Also:
OSGiGrizzlyAdapter.getProcessingLock(), ReentrantReadWriteLock.WriteLock


Copyright © 2012 Oracle Corporation. All Rights Reserved.