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 ofEventingService
with JavaServiceLoader
. The order in whichEventingService
s are invoked can be controlled by annotating the class implementingEventingService
withjavax.annotation.Priority
. See alsoio.smallrye.graphql.execution.event.Priorities
containing relevant constants. When before* events happenEventingService
s are invoked by ascending @{code @Priority}, and for after* events invocations are done by descending @{code @Priority}. Meaning that anEventingService
with lowjavax.annotation.Priority
is executed first on the way in, and last on the way out.- Author:
- Phillip Kruger ([email protected])
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fireAfterDataFetch(Context context)
void
fireAfterExecute(Context context)
void
fireBeforeDataFetch(Context context)
void
fireBeforeExecute(Context context)
graphql.GraphQL.Builder
fireBeforeGraphQLBuild(graphql.GraphQL.Builder builder)
This gets fired just before we build the GraphQL objectvoid
fireBeforeMethodInvoke(InvokeInfo invokeInfo)
graphql.schema.GraphQLSchema.Builder
fireBeforeSchemaBuild(graphql.schema.GraphQLSchema.Builder builder)
This gets fired just before we create the final schema.Operation
fireCreateOperation(Operation operation)
This gets fired during the bootstrap phase before a new operation is being created.void
fireOnDataFetchError(Context context, Throwable t)
void
fireOnExecuteError(Context context, Throwable t)
Map<String,javax.json.bind.Jsonb>
fireOverrideJsonbConfig()
static EventEmitter
getInstance()
-
-
-
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
-
-