Home » geronimo-2.2-source-release » org.apache.geronimo.console.jmsmanager » [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
    4    *  this work for additional information regarding copyright ownership.
    5    *  The ASF licenses this file to You under the Apache License, Version 2.0
    6    *  (the "License"); you may not use this file except in compliance with
    7    *  the License.  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    *  Unless required by applicable law or agreed to in writing, software
   12    *  distributed under the License is distributed on an "AS IS" BASIS,
   13    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    *  See the License for the specific language governing permissions and
   15    *  limitations under the License.
   16    */
   17   
   18   package org.apache.geronimo.console.jmsmanager;
   19   
   20   import java.net.URI;
   21   
   22   import javax.portlet.ActionResponse;
   23   import javax.portlet.PortletRequest;
   24   
   25   import org.apache.geronimo.gbean.AbstractName;
   26   
   27   /**
   28    * @version $Rev: 813742 $ $Date: 2009-09-11 02:38:26 -0700 (Fri, 11 Sep 2009) $
   29    */
   30   public class JMSDestinationInfo {
   31   
   32       private AbstractName resourceAdapterModuleAbName;
   33   
   34       private String physicalName;
   35   
   36       private DestinationType type;
   37   
   38       public String getPhysicalName() {
   39           return physicalName;
   40       }
   41   
   42       public AbstractName getResourceAdapterModuleAbName() {
   43           return resourceAdapterModuleAbName;
   44       }
   45   
   46       public DestinationType getType() {
   47           return type;
   48       }
   49   
   50       public void setResourceAdapterModuleAbName(String resourceAdapterModuleName) {
   51           this.resourceAdapterModuleAbName = new AbstractName(URI.create(resourceAdapterModuleName));
   52       }
   53   
   54       public void setPhysicalName(String physicalName) {
   55           this.physicalName = physicalName;
   56       }
   57   
   58       public void setResourceAdapterModuleAbName(AbstractName resourceAdapterModuleAbName) {
   59           this.resourceAdapterModuleAbName = resourceAdapterModuleAbName;
   60       }
   61   
   62       public void setType(DestinationType type) {
   63           this.type = type;
   64       }
   65   
   66       public void setType(String type) {
   67           this.type = DestinationType.valueOf(type);
   68       }
   69   
   70       public static JMSDestinationInfo create(PortletRequest actionRequest) {
   71           JMSDestinationInfo jmsDestinationInfo = new JMSDestinationInfo();
   72           jmsDestinationInfo.setPhysicalName(actionRequest.getParameter("physicalName"));
   73           jmsDestinationInfo.setType(DestinationType.valueOf(actionRequest.getParameter("adminObjType")));
   74           jmsDestinationInfo.setResourceAdapterModuleAbName(actionRequest.getParameter("resourceAdapterModuleName"));
   75           return jmsDestinationInfo;
   76       }
   77   
   78       public void setRenderParameters(ActionResponse actionResponse) {
   79           actionResponse.setRenderParameter("physicalName", physicalName);
   80           actionResponse.setRenderParameter("adminObjType", type.name());
   81           actionResponse.setRenderParameter("resourceAdapterModuleName", resourceAdapterModuleAbName.toString());
   82       }
   83   }

Home » geronimo-2.2-source-release » org.apache.geronimo.console.jmsmanager » [javadoc | source]