Class RepositoryBuilder
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.internal.parser.RepositoryBuilder
-
- All Implemented Interfaces:
IEventSinkFactory
class RepositoryBuilder extends java.lang.Object implements IEventSinkFactory
Bridge class from event sink to repository. Since this class does not pass on events to another event sink, it must always be the last sink in a chain.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classRepositoryBuilder.DurationEventTypeEntry(package private) static classRepositoryBuilder.EventTypeEntryprivate static classRepositoryBuilder.InstantEventTypeEntry
-
Field Summary
Fields Modifier and Type Field Description private static DisjointBuilder.ArrayFactory<IItem>ARRAY_FACTORYprivate java.util.Map<java.lang.String,RepositoryBuilder.EventTypeEntry>eventTypesprivate static java.util.logging.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description RepositoryBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IEventSinkcreate(java.lang.String identifier, java.lang.String label, java.lang.String[] category, java.lang.String description, java.util.List<ValueField> dataStructure)Create a new event sink for an event type.private static RepositoryBuilder.EventTypeEntrycreateEventTypeEntry(java.lang.String identifier, java.lang.String label, java.lang.String[] category, java.lang.String description, java.util.List<ValueField> dataStructure)voidflush()Called when all events have been sent to the event sinks.java.util.Iterator<RepositoryBuilder.EventTypeEntry>getEventTypes()
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
eventTypes
private final java.util.Map<java.lang.String,RepositoryBuilder.EventTypeEntry> eventTypes
-
ARRAY_FACTORY
private static final DisjointBuilder.ArrayFactory<IItem> ARRAY_FACTORY
-
-
Method Detail
-
create
public IEventSink create(java.lang.String identifier, java.lang.String label, java.lang.String[] category, java.lang.String description, java.util.List<ValueField> dataStructure)
Description copied from interface:IEventSinkFactoryCreate a new event sink for an event type. This method will be called one or more times for every event type present in the Flight Recording.The implementation should have a subfactory that has been saved during instantiation with the
IParserExtension.getEventSinkFactorycall.The create call takes event type metadata which can optionally be modified before calling the create method of the subfactory to get a subsink. Note that
createmay be called multiple times on the subfactory to set up a case where a single input event type can be split into multiple output event types.The returned event sink is used to receive and optionally modify event data. This data is then passed on to the subsink.
Implementations of this method must be thread safe.
- Specified by:
createin interfaceIEventSinkFactory- Parameters:
identifier- event type IDlabel- human readable name for the event typecategory- a category path for the event typedescription- human readable description of the event typedataStructure- metadata for the event fields- Returns:
- an event sink
-
createEventTypeEntry
private static RepositoryBuilder.EventTypeEntry createEventTypeEntry(java.lang.String identifier, java.lang.String label, java.lang.String[] category, java.lang.String description, java.util.List<ValueField> dataStructure)
-
flush
public void flush()
Description copied from interface:IEventSinkFactoryCalled when all events have been sent to the event sinks. Make sure that all pending events have been processed before returning from this call.The implementation should have a subfactory.
flushmust be called on that just before returning.If no flush operations need to be done, then simply call flush on the subfactory.
- Specified by:
flushin interfaceIEventSinkFactory
-
getEventTypes
public java.util.Iterator<RepositoryBuilder.EventTypeEntry> getEventTypes()
-
-