FileDocCategorySizeDatePackage
JmsServiceEventListener.javaAPI DocGlassfish v2 API5157Fri May 04 22:35:40 BST 2007com.sun.enterprise.server

JmsServiceEventListener

public class JmsServiceEventListener extends Object implements com.sun.enterprise.admin.event.jms.JmsServiceEventListener
Listener interface to handle jms-service element events.
author:
alexkrav

Fields Summary
private ConnectorRegistry
registry
Constructors Summary
Methods Summary
private JmsServicegetJmsService(JmsServiceEvent event)

        ConfigContext context = event.getConfigContext();
        return ServerBeansFactory.getJmsServiceBean(context);
    
public voidhandleCreate(JmsServiceEvent event)
Handles element additions. It is called whenever a JmsServiceEvent is received.

param
event Event to be processed.
throws
AdminEventListenerException when the listener is unable to process the event.

    
public voidhandleDelete(JmsServiceEvent event)
Handles jms-service element removal. It is called whenever a JmsServiceEvent is received.

param
event Event to be processed.
throws
AdminEventListenerException when the listener is unable to process the event.


                                                                     
       
               
    
public voidhandleUpdate(JmsServiceEvent event)
Handles jms-service element modification (attributes/properties values changed). It is called whenever a JmsServiceEvent is received.

param
event Event to be processed.
throws
AdminEventListenerException when the listener is unable to process the event.

        try {
            JmsService service = getJmsService(event);
            ActiveJmsResourceAdapter ajr = (ActiveJmsResourceAdapter) 
                registry.getActiveResourceAdapter(ConnectorRuntime.DEFAULT_JMS_ADAPTER);
            if (ajr != null) {
                ajr.reloadRA(service);
            }
            JmsService oldService =  ServerBeansFactory.getJmsServiceBean(
                event.getOldConfigContext());
            if(!oldService.getType().equals(service.getType()))
                throw new AdminEventListenerException
                ("jms type is not dynamically configured");    
        } catch (ConnectorRuntimeException cre) {
            AdminEventListenerException ale = 
                new AdminEventListenerException(cre.getMessage());
            ale.initCause(cre);
            throw ale;
        } catch (Exception ce) {
            AdminEventListenerException ale = 
                new AdminEventListenerException(ce.getMessage());
            ale.initCause(ce);
            throw ale;
        }