Package org.apache.ws.resource

Examples of org.apache.ws.resource.Resource


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

      resource.setID( id );
      try
      {
         LOG.debug( MSG.getMessage( Keys.INIT_RESOURCE_LIFECYCLE_INSTANCE,
                                    resource.getClass(  ).getName(  ) ) );
         if ( resource.getEndpointReference(  ) == null ) //also checked in add(..) in case they sidestep this
         {
            resource.setEndpointReference( getEndpointReference( id ) );
         }

         resource.init(  );
      }
      catch ( RuntimeException re )
      {
         throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_INIT_RESOURCE, resource, re ), re );
      }
View Full Code Here


    * @throws ResourceException DOCUMENT_ME
    */
   protected Resource createNewInstanceAndLoad( Object id )
   throws ResourceException
   {
      Resource resource = createInstance( id );
      LOG.debug( MSG.getMessage( Keys.LOADING_RESOURCE_FROM_PERSISTENCE,
                                 String.valueOf( id ) ) );
      ( (PersistentResource) resource ).load(  );
      if ( ResourceSweeper.isExpired( resource ) )
      {
View Full Code Here

      }

      XmlObject propsDocXBean = XmlObject.Factory.parse( in, parseOpts );
      in.close(  );
      ResourcePropertySet propSet  = new XmlBeansResourcePropertySet( propsDocXBean );
      Resource            resource = createInstance( SushiResourceContext.ID );
      ( (PropertiesResource) resource ).setResourcePropertySet( propSet );
      add( resource );
   }
View Full Code Here

   throws ResourceException
   {
      LOG.debug( MSG.getMessage( Keys.GETTING_RESOURCE_WITH_ID,
                                 resourceId,
                                 getClass(  ).getName(  ) ) );
      Resource resource = (Resource) m_resources.get( getNonNullKey( resourceId ) );
      if ( resource == null )
      {
         if ( !m_resourceIsPersistent )
         {
            throw new ResourceUnknownException( resourceId,
View Full Code Here

   throws ResourceUnknownException,
          ResourceException
   {
      LOG.debug( MSG.getMessage( Keys.FINDING_RESOURCE_WITH_KEY,
                                 String.valueOf( resourceId ) ) );
      Resource resource = null;
      synchronized ( m_resources )
      {
         //Lock lock = acquireLock( resourceId );
         //try
         //{
View Full Code Here

    */
   public void remove( Object resourceId )
   throws ResourceUnknownException,
          ResourceException
   {
      Resource resource = null;
      Lock     lock = acquireLock( resourceId );
      try
      {
         resource = get( resourceId );

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

         Resource removedResource = (Resource) m_resources.remove( getNonNullKey( resourceId ) );
         if ( removedResource instanceof PropertiesResource )
         {
            notifyResourceDeletedListeners( removedResource );
         }

View Full Code Here

    */
   protected Resource createInstance( Object id )
   throws ResourceException
   {
      LOG.debug( MSG.getMessage( Keys.CREATING_RESOURCE_WITH_ID, id ) );
      Resource resource = createInstanceViaSpringBeanFactory(  );
      if ( resource == null )
      {
         resource = createInstanceViaReflection(  );
      }

      if ( resource.getID(  ) == null )
      {
         resource.setID( id );
      }

      return resource;
   }
View Full Code Here

    * @throws ResourceException DOCUMENT_ME
    */
   protected Resource createNewInstanceAndLoad( Object id )
   throws ResourceException
   {
      Resource resource = createInstance( id );
      LOG.debug( MSG.getMessage( Keys.LOADING_RESOURCE_FROM_PERSISTENCE,
                                 String.valueOf( id ) ) );
      ( (PersistentResource) resource ).load(  );
      if ( ResourceSweeper.isExpired( resource ) )
      {
View Full Code Here

   }

   private Resource createInstanceViaReflection(  )
   throws ResourceException
   {
      Resource resource;
      try
      {
         resource = (Resource) m_resourceClass.newInstance(  );
      }
      catch ( Exception e )
View Full Code Here

   }

   private Resource createInstanceViaSpringBeanFactory(  )
   throws ResourceException
   {
      Resource            resource    = null;
      ListableBeanFactory beanFactory = WsrfRuntime.getRuntime(  ).getBeanFactory(  );
      if ( beanFactory != null )
      {
         String[] beanDefNames = beanFactory.getBeanNamesForType( m_resourceClass );
         if ( beanDefNames.length != 0 )
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.