Class EventEmitter
- java.lang.Object
-
- io.smallrye.graphql.execution.event.EventEmitter
-
public class EventEmitter extends Object
Fire some events while booting or executing. This allows some extension Loads implementations ofEventingServicewith JavaServiceLoader. The order in whichEventingServices are invoked can be controlled by annotating the class implementingEventingServicewithjavax.annotation.Priority. See alsoio.smallrye.graphql.execution.event.Prioritiescontaining relevant constants. When before* events happenEventingServices are invoked by ascending @{code @Priority}, and for after* events invocations are done by descending @{code @Priority}. Meaning that anEventingServicewith lowjavax.annotation.Priorityis executed first on the way in, and last on the way out.- Author:
- Phillip Kruger (phillip.kruger@redhat.com)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfireAfterDataFetch(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.OperationfireCreateOperation(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)Map<String,jakarta.json.bind.Jsonb>fireOverrideJsonbConfig()static EventEmittergetInstance()
-
-
-
Method Detail
-
getInstance
public static EventEmitter getInstance()
-
fireBeforeExecute
public void fireBeforeExecute(Context context)
-
fireAfterExecute
public void fireAfterExecute(Context context)
-
fireBeforeDataFetch
public void fireBeforeDataFetch(Context context)
-
fireBeforeMethodInvoke
public void fireBeforeMethodInvoke(InvokeInfo invokeInfo) throws Exception
- Throws:
Exception
-
fireAfterDataFetch
public void fireAfterDataFetch(Context context)
-
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
public Operation fireCreateOperation(Operation operation)
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
-
-