Package org.apache.ws.resource

Examples of org.apache.ws.resource.Resource


       {
           throw new ResourceException(e);
       }
       ResourceKey key = getResourceKey( QName.valueOf(home.getResourceKeyName()), resourceKeyClass);
      LOG.debug( MSG.getMessage( Keys.LOOKUP_RESOURCE_FOR_KEY, key.getValue()));
      Resource resource = home.find( key );
      LOG.debug( MSG.getMessage( Keys.FOUND_RESOURCE, resource ));
      return resource;
   }
View Full Code Here


            throws ResourceException,
            ResourceContextException,
            ResourceUnknownException
    {

        Resource resource = null;
        ResourceKey key = resourceContext.getResourceKey();
        try
        {   //added because of AbstractPortType
            resource = null;
            try
View Full Code Here

   throws ResourceException
   {

      LOG.debug(MSG.getMessage(Keys.FINDING_RESOURCE_WITH_KEY, String.valueOf(key)));

      Resource resource = null;
      Lock lock = getLock(key);
       try
      {
         lock.acquire(  );
      }
View Full Code Here

    */
   public void remove( ResourceKey key )
   throws ResourceException
   {

      Resource resource = null;
      Lock  lock = getLock(key);
       try
      {
         lock.acquire(  );
      }
      catch ( InterruptedException ie )
      {
         throw new ResourceException( ie );
      }

      try
      {
         resource = get( key );

            try
            {
               resource.destroy(  );
            }
            catch ( RuntimeException re )
            {
               throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_DESTROY_RESOURCE, resource, re ));
            }


         m_resources.remove( getLookupKey(key) );

         LOG.debug( MSG.getMessage( Keys.REMOVED_RESOURCE_WITH_KEY, resource.getClass(  ).getName(  ) ,String.valueOf(key) ));
         if ( m_cache != null )
         {
            m_cache.remove( resource );
         }
      }
View Full Code Here

    */
   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

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

   throws ResourceException
   {

      LOG.debug(MSG.getMessage(Keys.FINDING_RESOURCE_WITH_KEY, String.valueOf(key)));

      Resource resource = null;
      Lock lock = getLock(key);
       try
      {
         lock.acquire(  );
      }
View Full Code Here

    */
   public void remove( ResourceKey key )
   throws ResourceException
   {

      Resource resource = null;
      Lock  lock = getLock(key);
       try
      {
         lock.acquire(  );
      }
      catch ( InterruptedException ie )
      {
         throw new ResourceException( ie );
      }

      try
      {
         resource = get( key );

            try
            {
               resource.destroy(  );
            }
            catch ( RuntimeException re )
            {
               throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_DESTROY_RESOURCE, resource, re ));
            }


         m_resources.remove( getLookupKey(key) );

         LOG.debug( MSG.getMessage( Keys.REMOVED_RESOURCE_WITH_KEY, resource.getClass(  ).getName(  ) ,String.valueOf(key) ));
         if ( m_cache != null )
         {
            m_cache.remove( resource );
         }
      }
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.