FileDocCategorySizeDatePackage
LifeCycleEventFactory.javaAPI DocGlassfish v2 API4293Fri May 04 22:33:44 BST 2007com.sun.enterprise.admin.selfmanagement.event

LifeCycleEventFactory

public final class LifeCycleEventFactory extends EventAbstractFactory
author
Sun Micro Systems, Inc

Fields Summary
private static final LifeCycleEventFactory
instance
Constructors Summary
private LifeCycleEventFactory()

        super();
        EventBuilder.getInstance().addEventFactory(EVENT_LIFECYCLE, this);
        try {
            LifeCycleImpl impl = (LifeCycleImpl) getMBeanServer().instantiate(
                    "com.sun.enterprise.admin.selfmanagement.event.LifeCycleImpl");
            getMBeanServer().registerMBean(impl,LifeCycleEvent.getLifeCycleImplObjectName());
        } catch (javax.management.ReflectionException rex) {
            _logger.log(Level.WARNING,"smgt.internal_error", rex);
        } catch (javax.management.InstanceAlreadyExistsException iex) {
            _logger.log(Level.WARNING,"smgt.internal_error", iex);
        } catch (Exception ex) {
            _logger.log(Level.WARNING,"smgt.internal_error", ex);
            
        }
    
Methods Summary
static com.sun.enterprise.admin.selfmanagement.event.LifeCycleEventFactorygetInstance()

        return instance;
    
public EventinstrumentEvent(com.sun.enterprise.config.serverbeans.ElementProperty[] properties, java.lang.String description)

        String eventName = null;
        for( int i = 0; i < properties.length; i++ ){
            ElementProperty property = properties[i];
            String propertyName = property.getName( ).toLowerCase( );
            if( propertyName.equals(PROPERTY_LIFECYCLE_NAME)) {
                eventName = "lifecycle." + property.getValue( ).toLowerCase( );
                if (!LifeCycleEvent.isValidType(eventName))
                    throw new IllegalArgumentException(
                            sm.getString("name","selfmgmt_event.invalid_event_property","lifecycle"));
            }
        }
        return new LifeCycleEvent(eventName, new LifeCycleNotificationFilter(eventName), description);