Class CommandInvokedEvent
java.lang.Object
org.glassfish.internal.api.events.CommandInvokedEvent
An HK2 event that is triggered when an Admin command is invoked via the REST interface (including Admin Console and CLI).
To listen to this event, create an HK2 subscriber with the following:
-
annotation on the class or otherwise register the class as an HK2 service
invalid reference
Service MessageReceiverqualifier annotation on the class with theCommandInvokedEventmessage type- A listener method with void return type and a single argument of the
CommandInvokedEventtype annotated with theSubscribeToannotation - Make sure that this subscriber is started as an HK2 service to receive the events
An example listener:
@Service
@RunLevel(value = StartupRunLevel.VAL, mode = RunLevel.RUNLEVEL_MODE_NON_VALIDATING)
@MessageReceiver({CommandInvokedEvent.class})
public class CommandSubscriber {
public void commandInvoked(@SubscribeTo CommandInvokedEvent event) {
log(event);
}
}
- Author:
- Ondro Mihalyi
-
Constructor Summary
ConstructorsConstructorDescriptionCommandInvokedEvent(String commandName, org.glassfish.api.admin.ParameterMap parameters, Subject subject) -
Method Summary
Modifier and TypeMethodDescriptionorg.glassfish.api.admin.ParameterMapOptional<org.glassfish.security.common.UserPrincipal>
-
Constructor Details
-
CommandInvokedEvent
-
-
Method Details
-
getCommandName
-
getParameters
public org.glassfish.api.admin.ParameterMap getParameters() -
getSubject
-
getUserPrincipal
-