org.exoplatform.services.rest
Class ResourceBinder

java.lang.Object
  extended by org.exoplatform.services.rest.ResourceBinder
All Implemented Interfaces:
org.picocontainer.Startable

public class ResourceBinder
extends Object
implements org.picocontainer.Startable

Created by The eXo Platform SAS.
For binding and unbinding ResourceContainers.

Version:
$Id: $
Author:
Gennady Azarenkov

Constructor Summary
ResourceBinder(org.exoplatform.container.xml.InitParams params, org.exoplatform.container.ExoContainerContext containerContext)
          Constructor sets the resolving strategy.
 
Method Summary
 void bind(ResourceContainer resourceCont)
          Bind ResourceContainer resourceCont if validation for this container is ok.
 void clear()
          Clear the list of ResourceContainer description.
 List<ResourceDescriptor> getAllDescriptors()
           
 void start()
           
 void stop()
           
 void unbind(ResourceContainer resourceCont)
          Unbind single ResourceContainer.
 void unbind(String className)
          Unbind ResourceContainer with given class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceBinder

public ResourceBinder(org.exoplatform.container.xml.InitParams params,
                      org.exoplatform.container.ExoContainerContext containerContext)
               throws Exception
Constructor sets the resolving strategy. Currently HTTPAnnotatedContainerResolvingStrategy (annotations used for description ResourceContainers)

Parameters:
params - class name for ResourceContainerResolvingStrategy
containerContext - ExoContainer context
Throws:
Exception - any exception
Method Detail

bind

public final void bind(ResourceContainer resourceCont)
                throws InvalidResourceDescriptorException
Bind ResourceContainer resourceCont if validation for this container is ok. After binding new component(s) to the ResourceDescriptor list it must be sorted by number of parameter in URITemplate. The resources which have more parameters must be at the begin of list, the resources which have less parameter must be at the and of it.
See example:

Parameters:
resourceCont - the Resource Container
Throws:
InvalidResourceDescriptorException - if validation failed.

unbind

public final void unbind(ResourceContainer resourceCont)
Unbind single ResourceContainer.

Parameters:
resourceCont - the ResourceContainer which should be unbinded.

unbind

public final void unbind(String className)
Unbind ResourceContainer with given class name.

Parameters:
className - the class name.

clear

public final void clear()
Clear the list of ResourceContainer description.


getAllDescriptors

public final List<ResourceDescriptor> getAllDescriptors()
Returns:
all resources descriptors.

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable


Copyright © 2009 eXo Platform SAS. All Rights Reserved.