Package org.apache.ws.muse.example.businessprocesstype

Source Code of org.apache.ws.muse.example.businessprocesstype.BusinessprocesstypeHome

/*=============================================================================*
*  Copyright 2005 The Apache Software Foundation
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*=============================================================================*/
package org.apache.ws.muse.example.businessprocesstype;

import org.apache.ws.addressing.EndpointReference;
import org.apache.ws.muse.example.resourceadmin.properties.CreateParamsType;
import org.apache.ws.resource.Resource;
import org.apache.ws.resource.ResourceContext;
import org.apache.ws.resource.ResourceContextException;
import org.apache.ws.resource.ResourceException;
import org.apache.ws.resource.ResourceUnknownException;
import org.apache.ws.resource.impl.AbstractResourceHome;

import javax.xml.namespace.QName;
import java.io.Serializable;
import java.util.Map;

/**
* @author Kinga Dziembowski
*
* Home for Businessprocesstype WS-Resources.
*/
public class BusinessprocesstypeHome
   extends AbstractResourceHome
   implements Serializable
{
   /**  The service endpoint name as registered with the SOAP Platform.  This is useful for building EPR's. **/
   public static final QName SERVICE_NAME =
      javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/muse/example/businessprocesstype}businessprocesstype" );

   /** DOCUMENT_ME */
   public static final QName RESOURCE_ID =
      javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/muse/example/businessprocesstype}ResourceID" );

   /** The management PortType associated with this resource. This is useful for building EPR's.**/
   public static final QName PORT_TYPE =
      javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/muse/example/businessprocesstype}BusinessProcessTypePortType" );

   /** The WSDL Port name associated with the resource. This is useful for building EPR's. **/
   public static final String PORT_NAME = "businessprocesstype";

   /** The name of the resource key for this resource. **/
   public static final QName RESOURCE_KEY_NAME = RESOURCE_ID;

   /**
    * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
    */
   public static final org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl SPEC_NAMESPACE_SET =
      new org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl(  );

   /** A constant for the JNDI Lookup name for this home. **/
   public static final String HOME_LOCATION =
      org.apache.ws.resource.JndiConstants.CONTEXT_NAME_SERVICES + "/" + SERVICE_NAME.getLocalPart(  ) + "/"
      + org.apache.ws.resource.JndiConstants.ATOMIC_NAME_HOME;

   //keeps track of instances ids
   private long m_instances = 0;

   /**
    * DOCUMENT_ME
    *
    * @return DOCUMENT_ME
    */
   public QName getPortType(  )
   {
      return PORT_TYPE;
   }

   /**
    * DOCUMENT_ME
    *
    * @return DOCUMENT_ME
    */
   public QName getResourceKeyNameQName(  )
   {
      return RESOURCE_KEY_NAME;
   }

   /**
    * DOCUMENT_ME
    *
    * @return DOCUMENT_ME
    */
   public QName getServiceName(  )
   {
      return SERVICE_NAME;
   }

   /**
    * DOCUMENT_ME
    *
    * @return DOCUMENT_ME
    */
   public String getServicePortName(  )
   {
      return PORT_NAME;
   }

   /**
    * DOCUMENT_ME
    *
    * @param resourceContext DOCUMENT_ME
    * @param params DOCUMENT_ME
    *
    * @return DOCUMENT_ME
    *
    * @throws ResourceException DOCUMENT_ME
    * @throws ResourceContextException DOCUMENT_ME
    * @throws ResourceUnknownException DOCUMENT_ME
    */
   public Resource create( ResourceContext  resourceContext,
                           CreateParamsType params )
   throws ResourceException,
          ResourceContextException,
          ResourceUnknownException
   {
      Resource              resource  = null;
      long                  currentId = ++m_instances;
      Object resourceId = SERVICE_NAME + Long.toString( currentId );

      try
      {
         resource = new BusinessprocesstypeResource( resourceId, params );
         EndpointReference epr =
            getEndpointReference( resourceId );
         ( (BusinessprocesstypeResource) resource ).setEndpointReference( epr );
         resource.init(  );
         add( resource );
      }
      catch ( Exception e )
      {
         throw new ResourceException( e );
      }

      return resource;
   }

    /**
     * Map containing all FilesystemResource instances - this map <em>must</em> be static for
     * compatibility with certain JNDI providers.
     */
    private static Map s_resources;

    /**
     * Returns a map of all FilesystemResource instances. Used by the {@link org.apache.ws.resource.impl.AbstractResourceHome}
     * superclass.
     */
    protected synchronized final Map getResourceMap()
    {
        if ( s_resources == null )
        {
            s_resources = AbstractResourceHome.createResourceMap( m_resourceIsPersistent );
        }
        return s_resources;
    }
    public org.apache.ws.resource.properties.NamespaceVersionHolder getNamespaceVersionHolder()
    {
        return SPEC_NAMESPACE_SET;
    }

}
TOP

Related Classes of org.apache.ws.muse.example.businessprocesstype.BusinessprocesstypeHome

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.