Package io.micronaut.messaging
Class MessagingApplication
java.lang.Object
io.micronaut.messaging.MessagingApplication
- All Implemented Interfaces:
ApplicationContextLifeCycle<MessagingApplication>
,ApplicationContextProvider
,LifeCycle
,Described
,EmbeddedApplication<MessagingApplication>
,Closeable
,AutoCloseable
@Singleton
@Requires(missingBeans=EmbeddedApplication.class)
public class MessagingApplication
extends Object
implements EmbeddedApplication<MessagingApplication>, Described
An alternative
EmbeddedApplication
that gets activated for messaging applications when
no other application is present.- Since:
- 1.0
- Author:
- graemerocher
-
Constructor Summary
ConstructorDescriptionMessagingApplication
(ApplicationContext applicationContext, ApplicationConfiguration configuration) Constructs a new messaging application. -
Method Summary
Modifier and TypeMethodDescriptionResolves theApplicationContext
for this class.A description that describes this object.boolean
boolean
isServer()
This method returns whether the application is a server application or not.start()
Starts the lifecyle component.stop()
Stops the life cycle component.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.naming.Described
getDescription
Methods inherited from interface io.micronaut.runtime.EmbeddedApplication
getEnvironment, isForceExit
-
Constructor Details
-
MessagingApplication
public MessagingApplication(ApplicationContext applicationContext, ApplicationConfiguration configuration) Constructs a new messaging application.- Parameters:
applicationContext
- The contextconfiguration
- The configuration
-
-
Method Details
-
getApplicationContext
Description copied from interface:ApplicationContextProvider
Resolves theApplicationContext
for this class.- Specified by:
getApplicationContext
in interfaceApplicationContextProvider
- Specified by:
getApplicationContext
in interfaceEmbeddedApplication<MessagingApplication>
- Returns:
- The
ApplicationContext
for the server
-
getApplicationConfiguration
- Specified by:
getApplicationConfiguration
in interfaceEmbeddedApplication<MessagingApplication>
- Returns:
- The
ApplicationConfiguration
instance
-
isRunning
public boolean isRunning() -
isServer
public boolean isServer()Description copied from interface:EmbeddedApplication
This method returns whether the application is a server application or not. Server applications require that the thread be kept a live, preventing the application from exiting.- Specified by:
isServer
in interfaceEmbeddedApplication<MessagingApplication>
- Returns:
- True if the application is a server
-
start
Description copied from interface:LifeCycle
Starts the lifecyle component.- Specified by:
start
in interfaceApplicationContextLifeCycle<MessagingApplication>
- Specified by:
start
in interfaceLifeCycle
- Returns:
- This lifecycle component
-
stop
Description copied from interface:LifeCycle
Stops the life cycle component.- Specified by:
stop
in interfaceApplicationContextLifeCycle<MessagingApplication>
- Specified by:
stop
in interfaceLifeCycle
- Returns:
- This lifecycle component
-
getDescription
Description copied from interface:Described
A description that describes this object.- Specified by:
getDescription
in interfaceDescribed
- Returns:
- The description
-