Package com.mastfrog.acteur.annotations
Class GenericApplicationModule<T extends GenericApplication>
java.lang.Object
com.google.inject.AbstractModule
com.mastfrog.acteur.server.ServerModule<T>
com.mastfrog.acteur.annotations.GenericApplicationModule<T>
- All Implemented Interfaces:
com.google.inject.Module
Acteur ServerModule which uses GenericApplication. Page that have the
HttpCall annotation which are on the classpath will automatically be added,
and any bindings they specify will be bound in request scope. Any modules
with the @GuiceModule annotation will be automatically installed.
An exclusion list can be passed to
- Author:
- Tim Boudreau
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final com.mastfrog.settings.SettingsFields inherited from class com.mastfrog.acteur.server.ServerModule
appType, BACKGROUND_THREAD_POOL_NAME, BACKGROUND_THREADS, BYTEBUF_ALLOCATOR_SETTINGS_KEY, CUSTOMIZED_POOLED_ALLOCATOR, DEFAULT_ALLOCATOR, DEFAULT_COMPRESSION_LEVEL, DEFAULT_COMPRESSION_MEMORY_LEVEL, DEFAULT_COMPRESSION_THRESHOLD, DEFAULT_COMPRESSION_WINDOW_BITS, DEFAULT_CORS_ALLOW_CREDENTIALS, DEFAULT_CORS_ALLOW_ORIGIN, DEFAULT_CORS_ENABLED, DEFAULT_CORS_MAX_AGE_MINUTES, DEFAULT_DISABLE_LEAK_DETECTOR, DEFAULT_TCP_NODELAY, DEFAULT_WEBSOCKET_ENABLED, DELAY_EXECUTOR, DIRECT_ALLOCATOR, DIRECT_OR_HEAP_BY_PLATFORM, EVENT_THREADS, GUICE_BINDING_DEFAULT_CONTEXT_OBJECTS, HEAP_ALLOCATOR, HTTP_COMPRESSION, HTTP_COMPRESSION_CHECK_RESPONSE_CONTENT_TYPE, HTTP_COMPRESSION_LEVEL, HTTP_COMPRESSION_MEMORY_LEVEL, HTTP_COMPRESSION_THRESHOLD, HTTP_COMPRESSION_WINDOW_BITS, MAX_CONTENT_LENGTH, POOLED_ALLOCATOR, PORT, scope, SCOPED_BACKGROUND_THREAD_POOL_NAME, SCOPED_WORKER_THREAD_POOL_NAME, SETTINGS_KEY_BASE_PATH, SETTINGS_KEY_BIND_ADDRESS, SETTINGS_KEY_CHARSET, SETTINGS_KEY_CORS_ALLOW_CREDENTIALS, SETTINGS_KEY_CORS_ALLOW_HEADERS, SETTINGS_KEY_CORS_ALLOW_ORIGIN, SETTINGS_KEY_CORS_CACHE_CONTROL_MAX_AGE, SETTINGS_KEY_CORS_ENABLED, SETTINGS_KEY_CORS_MAX_AGE_MINUTES, SETTINGS_KEY_CORS_REPLACE_ALLOW_HEADERS, SETTINGS_KEY_CUSTOM_ALLOC_CACHE_ALIGNMENT, SETTINGS_KEY_CUSTOM_ALLOC_MAX_ORDER, SETTINGS_KEY_CUSTOM_ALLOC_NORMAL_CACHE_SIZE, SETTINGS_KEY_CUSTOM_ALLOC_NUM_DIRECT_ARENAS, SETTINGS_KEY_CUSTOM_ALLOC_NUM_HEAP_ARENAS, SETTINGS_KEY_CUSTOM_ALLOC_PAGE_SIZE, SETTINGS_KEY_CUSTOM_ALLOC_PREFER_DIRECT, SETTINGS_KEY_CUSTOM_ALLOC_SMALL_CACHE_SIZE, SETTINGS_KEY_CUSTOM_ALLOC_TINY_CACHE_SIZE, SETTINGS_KEY_CUSTOM_ALLOC_USE_CACHE_ALL_THREADS, SETTINGS_KEY_DECODE_REAL_IP, SETTINGS_KEY_DELAY_THREAD_POOL_THREADS, SETTINGS_KEY_DISABLE_LEAK_DETECTOR, SETTINGS_KEY_GENERATE_SECURE_URLS, SETTINGS_KEY_GENERATE_URLS_WITH_INET_ADDRESS_GET_LOCALHOST, SETTINGS_KEY_MAX_CHUNK_SIZE, SETTINGS_KEY_MAX_HEADER_BUFFER_SIZE, SETTINGS_KEY_MAX_REQUEST_LINE_LENGTH, SETTINGS_KEY_RENDER_STACK_TRACES, SETTINGS_KEY_SOCKET_CONNECT_TIMEOUT_MILLIS, SETTINGS_KEY_SOCKET_MAX_MESSAGES_PER_INDIVIDUAL_READ, SETTINGS_KEY_SOCKET_MAX_MESSAGES_PER_READ, SETTINGS_KEY_SOCKET_SO_RCVBUF, SETTINGS_KEY_SOCKET_SO_SNDBUF, SETTINGS_KEY_SOCKET_TCP_NODELAY, SETTINGS_KEY_SOCKET_WRITE_SPIN_COUNT, SETTINGS_KEY_SSL_ENABLED, SETTINGS_KEY_SSL_ENGINE, SETTINGS_KEY_SYSTEM_EXIT_ON_BIND_FAILURE, SETTINGS_KEY_URLS_EXTERNAL_PORT, SETTINGS_KEY_URLS_EXTERNAL_SECURE_PORT, SETTINGS_KEY_URLS_HOST_NAME, SETTINGS_KEY_USE_FORK_JOIN_POOL, SETTINGS_KEY_WEBSOCKETS_ENABLED, WORKER_THREAD_POOL_NAME, WORKER_THREADS, X_INTERNAL_COMPRESS, X_INTERNAL_COMPRESS_HEADER -
Constructor Summary
ConstructorsConstructorDescriptionGenericApplicationModule(com.mastfrog.giulius.scope.ReentrantScope scope, com.mastfrog.settings.Settings settings, Class<? extends T> appType, Class<?>... exclude) Create a new GenericApplicationModule with a specific subtype of GenericApplication, passing in the scope to be used for request scope.GenericApplicationModule(com.mastfrog.settings.Settings settings) Constructor which just takes a Settings, for use with giulius-testsGenericApplicationModule(com.mastfrog.settings.Settings settings, Class<?>... exclude) Create a new GenericApplicationModule using the passed settings and the specified class exclusion list.GenericApplicationModule(com.mastfrog.settings.Settings settings, Class<? extends T> appType, Class<?>... exclude) Create a new GenericApplicationModule with a specific subtype of GenericApplication. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidstatic <T extends com.google.inject.Module>
TinstantiateModule(Class<T> m, com.mastfrog.settings.Settings settings, com.mastfrog.giulius.scope.ReentrantScope scope) Methods inherited from class com.mastfrog.acteur.server.ServerModule
add, applicationScope, configureServerBootstrap, onAfterStart, onBeforeStart, onInitMethods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Field Details
-
settings
protected final com.mastfrog.settings.Settings settings -
EXCLUDED_CLASSES
- See Also:
-
-
Constructor Details
-
GenericApplicationModule
public GenericApplicationModule(com.mastfrog.settings.Settings settings) Constructor which just takes a Settings, for use with giulius-tests- Parameters:
settings-
-
GenericApplicationModule
Create a new GenericApplicationModule using the passed settings and the specified class exclusion list.- Parameters:
settings-exclude- A list of Page, Module or implicit binding classes which should be ignored
-
GenericApplicationModule
public GenericApplicationModule(com.mastfrog.settings.Settings settings, Class<? extends T> appType, Class<?>... exclude) Create a new GenericApplicationModule with a specific subtype of GenericApplication.- Parameters:
settings- SettingsappType- The application typeexclude- A list of Page, Module or implicit binding classes which should be ignored
-
GenericApplicationModule
public GenericApplicationModule(com.mastfrog.giulius.scope.ReentrantScope scope, com.mastfrog.settings.Settings settings, Class<? extends T> appType, Class<?>... exclude) Create a new GenericApplicationModule with a specific subtype of GenericApplication, passing in the scope to be used for request scope.- Parameters:
scope- The scope to bind types insettings- SettingsappType- The application typeexclude- A list of Page, Module or implicit binding classes which should be ignored
-
-
Method Details
-
instantiateModule
public static <T extends com.google.inject.Module> T instantiateModule(Class<T> m, com.mastfrog.settings.Settings settings, com.mastfrog.giulius.scope.ReentrantScope scope) throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException -
configure
protected void configure()- Overrides:
configurein classServerModule<T extends GenericApplication>
-