Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.jms.plugin » [javadoc | source]

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements. See the NOTICE file distributed with this
    4    * work for additional information regarding copyright ownership. The ASF
    5    * licenses this file to You under the Apache License, Version 2.0 (the
    6    * "License"); you may not use this file except in compliance with the License.
    7    * You may obtain a copy of the License at
    8    * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
    9    * or agreed to in writing, software distributed under the License is
   10    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   11    * KIND, either express or implied. See the License for the specific language
   12    * governing permissions and limitations under the License.
   13    */
   14   package org.apache.webbeans.jms.plugin;
   15   
   16   import javax.enterprise.inject.spi.Bean;
   17   
   18   import org.apache.webbeans.exception.WebBeansConfigurationException;
   19   import org.apache.webbeans.jms.JMSModel;
   20   import org.apache.webbeans.jms.component.JmsComponentFactory;
   21   import org.apache.webbeans.jms.component.JmsBean;
   22   import org.apache.webbeans.jms.util.JmsProxyHandler;
   23   import org.apache.webbeans.jms.util.JmsUtil;
   24   import org.apache.webbeans.plugins.AbstractOpenWebBeansPlugin;
   25   
   26   /**
   27    * JMS Plugin for JMS related components.
   28    * 
   29    * @version $Rev: 804761 $ $Date: 2009-08-16 23:17:50 +0300 (Sun, 16 Aug 2009) $
   30    */
   31   public class OpenWebBeansJmsPlugin extends AbstractOpenWebBeansPlugin implements org.apache.webbeans.plugins.OpenWebBeansJmsPlugin
   32   {
   33   
   34       public OpenWebBeansJmsPlugin()
   35       {
   36           super();
   37       }
   38   
   39       @Override
   40       public Bean<?> getJmsBean(JMSModel model)
   41       {
   42           JmsBean<?> bean = JmsComponentFactory.getJmsComponentFactory().getJmsComponent(model);
   43   
   44           return bean;
   45   
   46       }
   47   
   48       @Override
   49       public void shutDown() throws WebBeansConfigurationException
   50       {
   51           JmsProxyHandler.clearConnections();
   52       }
   53   
   54       @Override
   55       public Object getJmsBeanProxy(Bean<?> bean, Class<?> iface)
   56       {
   57           Object proxy = JmsUtil.createNewJmsProxy((JmsBean<?>) bean, iface);
   58   
   59           return proxy;
   60       }
   61   
   62   }

Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.jms.plugin » [javadoc | source]