Class EventEmitter
java.lang.Object
io.smallrye.graphql.execution.event.EventEmitter
Fire some events while booting or executing.
This allows some extension
Loads implementations of
EventingService with Java ServiceLoader.
The order in which EventingServices are invoked can be controlled by annotating the class implementing
EventingService with javax.annotation.Priority.
See also io.smallrye.graphql.execution.event.Priorities containing relevant constants.
When before* events happen EventingServices are invoked by ascending @{code @Priority}, and for after* events
invocations are done by descending @{code @Priority}.
Meaning that an EventingService with low javax.annotation.Priority is executed first on the way in,
and last on the way out.- Author:
- Phillip Kruger (phillip.kruger@redhat.com)
-
Method Summary
Modifier and TypeMethodDescriptionvoidfireAfterDataFetch(Context context) voidfireAfterExecute(Context context) voidfireBeforeDataFetch(Context context) voidfireBeforeExecute(Context context) graphql.GraphQL.BuilderfireBeforeGraphQLBuild(graphql.GraphQL.Builder builder) This gets fired just before we build the GraphQL objectvoidfireBeforeMethodInvoke(InvokeInfo invokeInfo) graphql.schema.GraphQLSchema.BuilderfireBeforeSchemaBuild(graphql.schema.GraphQLSchema.Builder builder) This gets fired just before we create the final schema.fireCreateOperation(Operation operation) This gets fired during the bootstrap phase before a new operation is being created.voidfireOnDataFetchError(Context context, Throwable t) voidfireOnExecuteError(Context context, Throwable t) static EventEmitter
-
Method Details
-
getInstance
-
fireBeforeExecute
-
fireOnExecuteError
-
fireAfterExecute
-
fireBeforeDataFetch
-
fireBeforeMethodInvoke
- Throws:
Exception
-
fireOnDataFetchError
-
fireAfterDataFetch
-
fireBeforeGraphQLBuild
public graphql.GraphQL.Builder fireBeforeGraphQLBuild(graphql.GraphQL.Builder builder) This gets fired just before we build the GraphQL object- Parameters:
builder- as it stands- Returns:
- builder modified by listener
-
fireBeforeSchemaBuild
public graphql.schema.GraphQLSchema.Builder fireBeforeSchemaBuild(graphql.schema.GraphQLSchema.Builder builder) This gets fired just before we create the final schema. This allows listeners to add to the builder any custom elements.- Parameters:
builder- as it stands- Returns:
- builder modified by listener
-
fireCreateOperation
This gets fired during the bootstrap phase before a new operation is being created. This allows listeners to modify the operation- Parameters:
operation- as it stands- Returns:
- operation possibly modified
-
fireOverrideJsonbConfig
-