FileDocCategorySizeDatePackage
EventBuilder.javaAPI DocGlassfish v2 API4829Tue Jul 24 22:50:48 BST 2007com.sun.enterprise.admin.selfmanagement.event

EventBuilder

public class EventBuilder extends Object
author
Sun Micro Systems, Inc

Fields Summary
private static final EventBuilder
instance
private static final ConcurrentHashMap
eventFactoryMap
private boolean
initialized
protected static final com.sun.enterprise.util.i18n.StringManager
sm
Constructors Summary
private EventBuilder()
Creates a new instance of EventBuilder

    
           
      
    
Methods Summary
public synchronized voidaddEventFactory(java.lang.String eventType, EventAbstractFactory factory)

        if ( eventFactoryMap.get( eventType ) == null)
            eventFactoryMap.put(eventType, factory);
    
public EventgetEvent(java.lang.String eventType, com.sun.enterprise.config.serverbeans.ElementProperty[] properties, java.lang.String description)
Given an event type, an event is returned. As of now, supported events are "log","monitor","lifecycle","notification" and "timer" in PE and in addition "gms" in EE.

param
eventType one of the supported event types
param
properties properties associated with the event
param
description event description
return
Event constructed event

        
        // guarantee that it's initialized
        // (better than before, but an ugly solution)
        Initer.getIniter();
        
        final EventAbstractFactory factory = eventFactoryMap.get( eventType );
        if( factory == null ) {
            throw new IllegalArgumentException(
                    sm.getString("selfmgmt_event.unknown_event_type",eventType));
        }
        
        return factory.instrumentEvent(properties, description);
    
public EventgetEvent(java.lang.String eventType, java.lang.String description, java.util.Hashtable attributes, com.sun.enterprise.config.serverbeans.ElementProperty[] properties)

        return getEvent(eventType,properties, description);
    
public static com.sun.enterprise.admin.selfmanagement.event.EventBuildergetInstance()

        return instance;