org.glassfish.jersey.internal.inject
Class AbstractModule

java.lang.Object
  extended by org.glassfish.jersey.internal.inject.AbstractModule
All Implemented Interfaces:
DynamicConfiguration, Binder, Module
Direct Known Subclasses:
ContextInjectionResolver.Module, ContextResolverFactory.Module, ExceptionMapperFactory.Module, ExceptionWrapperInterceptor.Module, JaxrsProviders.Module, MessageBodyFactory.Module, MessagingModules.HeaderDelegateProviders, MessagingModules.MessageBodyProviders, ProcessingModule, ProviderBinder.ProviderBinderModule, ProviderInstanceBindingModule, RequestScope.Module, ServiceFinderModule

public abstract class AbstractModule
extends java.lang.Object
implements Module, DynamicConfiguration

Skeleton implementation of injection module with convenience methods for binding definitions.

Author:
Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
AbstractModule()
           
 
Method Summary
<T> ActiveDescriptor<T>
addActiveDescriptor(ActiveDescriptor<T> activeDescriptor)
          

This method can be called only in the execution context of the configure() method.

<T> ActiveDescriptor<T>
addActiveDescriptor(java.lang.Class<T> rawClass)
          

This method can be called only in the execution context of the configure() method.

 void addUnbindFilter(Filter unbindFilter)
          

This method can be called only in the execution context of the configure() method.

 ActiveDescriptor<?> bind(Descriptor descriptor)
          

This method can be called only in the execution context of the configure() method.

 void bind(DynamicConfiguration configuration)
           
 FactoryDescriptors bind(FactoryDescriptors factoryDescriptors)
          

This method can be called only in the execution context of the configure() method.

 void commit()
          

This method can be called only in the execution context of the configure() method.

protected abstract  void configure()
          Implement to provide module binding definitions using the exposed binding methods.
 void install(Module... modules)
          Adds all binding definitions from the modules to the binding configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractModule

public AbstractModule()
Method Detail

bind

public void bind(DynamicConfiguration configuration)
Specified by:
bind in interface Binder

configure

protected abstract void configure()
Implement to provide module binding definitions using the exposed binding methods.


bind

public ActiveDescriptor<?> bind(Descriptor descriptor)

This method can be called only in the execution context of the configure() method.

Specified by:
bind in interface DynamicConfiguration

bind

public FactoryDescriptors bind(FactoryDescriptors factoryDescriptors)

This method can be called only in the execution context of the configure() method.

Specified by:
bind in interface DynamicConfiguration

addActiveDescriptor

public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor)
                                        throws java.lang.IllegalArgumentException

This method can be called only in the execution context of the configure() method.

Specified by:
addActiveDescriptor in interface DynamicConfiguration
Throws:
java.lang.IllegalArgumentException

addActiveDescriptor

public <T> ActiveDescriptor<T> addActiveDescriptor(java.lang.Class<T> rawClass)
                                        throws MultiException,
                                               java.lang.IllegalArgumentException

This method can be called only in the execution context of the configure() method.

Specified by:
addActiveDescriptor in interface DynamicConfiguration
Throws:
MultiException
java.lang.IllegalArgumentException

addUnbindFilter

public void addUnbindFilter(Filter unbindFilter)
                     throws java.lang.IllegalArgumentException

This method can be called only in the execution context of the configure() method.

Specified by:
addUnbindFilter in interface DynamicConfiguration
Throws:
java.lang.IllegalArgumentException

commit

public void commit()
            throws MultiException

This method can be called only in the execution context of the configure() method.

Specified by:
commit in interface DynamicConfiguration
Throws:
MultiException

install

public final void install(Module... modules)
Adds all binding definitions from the modules to the binding configuration.

Parameters:
modules - modules whose binding definitions should be configured.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.