Package org.apache.ws.resource

Examples of org.apache.ws.resource.Resource


    */
   protected Resource createInstance(ResourceKey key)
   throws ResourceException
   {
      LOG.debug(MSG.getMessage( Keys.CREATING_INSTANCE_WITH_KEY, String.valueOf(key)));
      Resource resource;
      try
      {
         resource = (Resource) getResourceClass(  ).newInstance(  );
      }
      catch ( Exception e )
      {
         throw new ResourceException( e );
      }

         resource.setID( key != null ? key.getValue() : null );

         try
         {
            LOG.debug(MSG.getMessage( Keys.INIT_RESOURCE_LIFECYCLE_INSTANCE, resource.getClass().getName()));
            resource.init();
         }
         catch ( RuntimeException re )
         {
            throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_INIT_RESOURCE, resource, re ));
         }
View Full Code Here


    * @throws ResourceException DOCUMENT_ME
    */
   protected Resource createNewInstanceAndLoad( ResourceKey key )
   throws ResourceException
   {
      Resource resource = createInstance( key);
      LOG.debug(MSG.getMessage( Keys.LOADING_RESORUCE_FROM_PERSISTENCE, String.valueOf(key)));
      ( (PersistenceCallback) resource ).load( key );
      return resource;
   }
View Full Code Here

   private Resource get( ResourceKey key )
   throws ResourceException
   {
      LOG.debug(MSG.getMessage( Keys.GET_RESOURCE_FOR_KEY,String.valueOf(key)));
       Object lookupKey = getLookupKey(key);
       Resource resource = (Resource) m_resources.get( lookupKey );
      if ( resource == null )
      {
         if ( m_resourceIsPersistent )
         {
            resource = createNewInstanceAndLoad( key );
View Full Code Here

     *
     * @param event
     */
    public void creationOccurred(ResourceCreationEvent event)
    {
        Resource resource = event.getResource();

        //determine if resource is a muws resource
        ResourceProperty identityProperty = getIdentityProperty(resource);
        if (identityProperty != null)
        {
            CreationNotificationDocument creationNotifDoc = CreationNotificationDocument.Factory.newInstance();
            CreationNotificationDocument.CreationNotification creationNotif = creationNotifDoc.addNewCreationNotification();
            EndpointReference epr = resource.getEndpointReference();
            if (epr != null && epr instanceof XmlBeansEndpointReference)
            {
                XmlBeansEndpointReference xBeansEPR = (XmlBeansEndpointReference) epr;
                XmlObject xBean = xBeansEPR.getXmlObject(org.apache.ws.addressing.v2004_08_10.AddressingConstants.NSURI_ADDRESSING_SCHEMA);
                if (xBean instanceof EndpointReferenceType)
View Full Code Here

     *
     * @param event
     */
    public void destructionOccurred(ResourceDestructionEvent event)
    {
        Resource resource = event.getResource();
        ResourceProperty identityProperty = getIdentityProperty(resource);
        if (identityProperty != null)
        {
            XmlAnyURI id = (XmlAnyURI) identityProperty.get(0);
            String resourceID = null;
View Full Code Here

            throws ResourceException,
                   ResourceContextException,
                   ResourceUnknownException
    {
        ResourceKey key = resourceContext.getResourceKey();
        Resource resource = null;
        try
        {
            synchronized (m_lock)
            {
                resource = find(key); //attempt to find from the underlying cache
View Full Code Here

            throws ResourceException,
                   ResourceContextException,
                   ResourceUnknownException
    {
        ResourceKey key = resourceContext.getResourceKey();
        Resource resource = null;
        try
        {
            synchronized (m_lock)
            {
                resource = find(key); //attempt to find from the underlying cache
View Full Code Here

            throws ResourceException,
                   ResourceContextException,
                   ResourceUnknownException
    {
        ResourceKey key = resourceContext.getResourceKey();
        Resource resource = null;
        try
        {
            resource = find(key);
        }
        catch (ResourceException re)
View Full Code Here

                           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 );
View Full Code Here

                           CreateParamsType params )
   throws ResourceException,
          ResourceContextException,
          ResourceUnknownException
   {
      Resource              resource;
      long                  currentId = ++m_instances;
      Object resourceId = SERVICE_NAME + Long.toString( currentId );
      try
      {
         // resource = createInstance(aKey);
         resource = new ApplicationResource( resourceId, params );
         EndpointReference epr =
            getEndpointReference( resourceId );
         ( (ApplicationResource) resource ).setEndpointReference( epr );
         resource.init(  );
         add( resource );
      }
      catch ( Exception e )
      {
         throw new ResourceException( e );
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.Resource

Copyright © 2018 www.massapicom. 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.