当前位置: 首页>>代码示例>>Java>>正文


Java ResourceKey类代码示例

本文整理汇总了Java中org.globus.wsrf.ResourceKey的典型用法代码示例。如果您正苦于以下问题:Java ResourceKey类的具体用法?Java ResourceKey怎么用?Java ResourceKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ResourceKey类属于org.globus.wsrf包,在下文中一共展示了ResourceKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createResource

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
	* Creates a new Resource, adds it to the list of resources managed by this resource home,
	* and returns the key to the resource.
	*/
public ResourceKey createResource() throws Exception {
	// Create a resource and initialize it
	GalleryResource resource = (GalleryResource) createNewInstance();
	// Create the resource properties bean so that the resource can use it to hold the  resource property values
	GalleryResourceProperties props = new GalleryResourceProperties();
       
       // Get a unique id for the resource
       Object id = UUIDGEN.nextUUID();
       
       // Create the resource key set it on the resource
	// this key is used for index service registration
	ResourceKey key = new SimpleResourceKey(getKeyTypeName(), id);
	resource.setResourceKey(key);
	
       resource.initialize(props, GalleryConstants.RESOURCE_PROPERTY_SET, id);

	// Add the resource to the list of resources in this home
	add(key, resource);
	return key;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:25,代码来源:GalleryResourceHome.java

示例2: createResource

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
	* Creates a new Resource, adds it to the list of resources managed by this resource home,
	* and returns the key to the resource.
	*/
public ResourceKey createResource() throws Exception {
	// Create a resource and initialize it
	StockPortfolioManagerResource resource = (StockPortfolioManagerResource) createNewInstance();
	// Create the resource properties bean so that the resource can use it to hold the  resource property values
	StockPortfolioManagerResourceProperties props = new StockPortfolioManagerResourceProperties();
       
       // Get a unique id for the resource
       Object id = UUIDGEN.nextUUID();
       
       // Create the resource key set it on the resource
	// this key is used for index service registration
	ResourceKey key = new SimpleResourceKey(getKeyTypeName(), id);
	resource.setResourceKey(key);
	
       resource.initialize(props, StockPortfolioManagerConstants.RESOURCE_PROPERTY_SET, id);

	// Add the resource to the list of resources in this home
	add(key, resource);
	return key;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:25,代码来源:StockPortfolioManagerResourceHome.java

示例3: createResource

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
	* Creates a new Resource, adds it to the list of resources managed by this resource home,
	* and returns the key to the resource.
	*/
public ResourceKey createResource() throws Exception {
	// Create a resource and initialize it
	TavernaWorkflowServiceImplResource resource = (TavernaWorkflowServiceImplResource) createNewInstance();
	// Create the resource properties bean so that the resource can use it to hold the  resource property values
	TavernaWorkflowServiceImplResourceProperties props = new TavernaWorkflowServiceImplResourceProperties();
       
       // Get a unique id for the resource
       Object id = UUIDGEN.nextUUID();
       
       // Create the resource key set it on the resource
	// this key is used for index service registration
	ResourceKey key = new SimpleResourceKey(getKeyTypeName(), id);
	resource.setResourceKey(key);
	
       resource.initialize(props, TavernaWorkflowServiceImplConstants.RESOURCE_PROPERTY_SET, id);

	// Add the resource to the list of resources in this home
	add(key, resource);
	return key;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:TavernaWorkflowServiceImplResourceHome.java

示例4: getResponse

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
 * Private method to create the enumeration resource in the enum resource home
 * 
 * @param iter
 * 		The enum iter instance to use
 * @param persist
 * 		True to use the enumeration impl's persistance (mostly broken)
 * @param expiration
 * 		Resource expiration information
 * @return
 * 		The enumerate response
 * @throws EnumerationCreationException
 */
private static EnumerateResponse getResponse(EnumIterator iter, boolean persist, ExpirationType expiration) 
	throws EnumerationCreationException {
	try {
		EnumResourceHome resourceHome = EnumResourceHome.getEnumResourceHome();
		EnumResource resource = resourceHome.createEnumeration(iter, persist);
		ResourceKey key = resourceHome.getKey(resource);
		EnumerationContextType enumContext = 
			EnumProvider.createEnumerationContextType(key);
		
		EnumerateResponse response = new EnumerateResponse(new MessageElement[] {}, enumContext, expiration);
		return response;
	} catch (Exception ex) {
		throw new EnumerationCreationException(ex.getClass().getName() + " -- " + ex.getMessage(), ex);
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:29,代码来源:EnumerateResponseFactory.java

示例5: createResource

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
	* Creates a new Resource, adds it to the list of resources managed by this resource home,
	* and returns the key to the resource.
	*/
public ResourceKey createResource() throws Exception {
	// Create a resource and initialize it
	TransferServiceContextResource resource = (TransferServiceContextResource) createNewInstance();
	// Create the resource properties bean so that the resource can use it to hold the  resource property values
	TransferServiceContextResourceProperties props = new TransferServiceContextResourceProperties();
       
       // Get a unique id for the resource
       Object id = UUIDGEN.nextUUID();
       
       // Create the resource key set it on the resource
	// this key is used for index service registration
	ResourceKey key = new SimpleResourceKey(getKeyTypeName(), id);
	resource.setResourceKey(key);
	
       resource.initialize(props, TransferServiceContextConstants.RESOURCE_PROPERTY_SET, id);

	// Add the resource to the list of resources in this home
	add(key, resource);
	return key;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:TransferServiceContextResourceHome.java

示例6: createResource

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
	* Creates a new Resource, adds it to the list of resources managed by this resource home,
	* and returns the key to the resource.
	*/
public ResourceKey createResource() throws Exception {
	// Create a resource and initialize it
	FederatedQueryResultsRetrievalResource resource = (FederatedQueryResultsRetrievalResource) createNewInstance();
	// Create the resource properties bean so that the resource can use it to hold the  resource property values
	FederatedQueryResultsRetrievalResourceProperties props = new FederatedQueryResultsRetrievalResourceProperties();
       
       // Get a unique id for the resource
       Object id = UUIDGEN.nextUUID();
       
       // Create the resource key set it on the resource
	// this key is used for index service registration
	ResourceKey key = new SimpleResourceKey(getKeyTypeName(), id);
	resource.setResourceKey(key);
	
       resource.initialize(props, FederatedQueryResultsRetrievalConstants.RESOURCE_PROPERTY_SET, id);

	// Add the resource to the list of resources in this home
	add(key, resource);
	return key;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:FederatedQueryResultsRetrievalResourceHome.java

示例7: createResource

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
	* Creates a new Resource, adds it to the list of resources managed by this resource home,
	* and returns the key to the resource.
	*/
public ResourceKey createResource() throws Exception {
	// Create a resource and initialize it
	FederatedQueryResultsResource resource = (FederatedQueryResultsResource) createNewInstance();
	// Create the resource properties bean so that the resource can use it to hold the  resource property values
	FederatedQueryResultsResourceProperties props = new FederatedQueryResultsResourceProperties();
       
       // Get a unique id for the resource
       Object id = UUIDGEN.nextUUID();
       
       // Create the resource key set it on the resource
	// this key is used for index service registration
	ResourceKey key = new SimpleResourceKey(getKeyTypeName(), id);
	resource.setResourceKey(key);
	
       resource.initialize(props, FederatedQueryResultsConstants.RESOURCE_PROPERTY_SET, id);

	// Add the resource to the list of resources in this home
	add(key, resource);
	return key;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:FederatedQueryResultsResourceHome.java

示例8: find

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
public Resource find(ResourceKey key) throws ResourceException {
    if (key != null) {
        throw new NoSuchResourceException();
    }

    synchronized (this) {

        // if we do not already have a value, call findSingleton()
        // and then cache the result.
        if (this.singleResource == null) {
            // check to see if the resource is persisted
            this.singleResource = createSingleton();
        }
        if (this.singleResource == null) {
            throw new NoSuchResourceException();
        }

    }
    return this.singleResource;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:SingletonResourceHomeImpl.java

示例9: find

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
public Resource find(ResourceKey key) throws ResourceException {
	BaseResource resource = (BaseResource) super.find(key);
	// each time the resource is looked up, do a lazy refreash of
	// registration.
	resource.refreshRegistration(false);
	return resource;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:8,代码来源:BaseResourceHome.java

示例10: getResourceReference

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
	* Take a resource key managed by this resource, locates the resource, and created a typed EPR for the resource.
	*/
public org.cagrid.demo.photosharing.gallery.stubs.types.GalleryReference getResourceReference(ResourceKey key) throws Exception {
	MessageContext ctx = MessageContext.getCurrentContext();
	String transportURL = (String) ctx.getProperty(org.apache.axis.MessageContext.TRANS_URL);
	transportURL = transportURL.substring(0,transportURL.lastIndexOf('/') +1 );
	transportURL += "Gallery";
	EndpointReferenceType epr = AddressingUtils.createEndpointReference(transportURL,key);
	org.cagrid.demo.photosharing.gallery.stubs.types.GalleryReference ref = new org.cagrid.demo.photosharing.gallery.stubs.types.GalleryReference();
	ref.setEndpointReference(epr);
	return ref;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:14,代码来源:GalleryResourceHome.java

示例11: load

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
public void load(ResourceKey resourceKey) throws ResourceException, NoSuchResourceException, InvalidResourceKeyException {
beingLoaded = true;
    //first we will recover the resource properties and initialize the resource
 StockPortfolioManagerResourceProperties props = (StockPortfolioManagerResourceProperties)resourcePropertyPersistenceHelper.load(StockPortfolioManagerResourceProperties.class, resourceKey.getValue());
    this.initialize(props, StockPortfolioManagerConstants.RESOURCE_PROPERTY_SET, resourceKey.getValue());
    
     //next we will recover the resource itself
     File file = resourcePersistenceHelper.getKeyAsFile(this.getClass(), resourceKey.getValue());
     if (!file.exists()) {
         beingLoaded = false;
         throw new NoSuchResourceException();
     }
     FileInputStream fis = null;
     int value = 0;
     try {
         fis = new FileInputStream(file);
         ObjectInputStream ois = new ObjectInputStream(fis);
         SubscriptionPersistenceUtils.loadSubscriptionListeners(
             this.getTopicList(), ois);
loadResource(resourceKey,ois);
     } catch (Exception e) {
         beingLoaded = false;
         throw new ResourceException("Failed to load resource", e);
     } finally {
         if (fis != null) {
             try { fis.close(); } catch (Exception ee) {}
         }
     } 
    
    beingLoaded = false;
 }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:32,代码来源:StockPortfolioManagerResourceBase.java

示例12: getResourceReference

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
/**
	* Take a resource key managed by this resource, locates the resource, and created a typed EPR for the resource.
	*/
public org.cagrid.introduce.tutorial.stockmanager.portfolio.stubs.types.StockPortfolioManagerReference getResourceReference(ResourceKey key) throws Exception {
	MessageContext ctx = MessageContext.getCurrentContext();
	String transportURL = (String) ctx.getProperty(org.apache.axis.MessageContext.TRANS_URL);
	transportURL = transportURL.substring(0,transportURL.lastIndexOf('/') +1 );
	transportURL += "StockPortfolioManager";
	EndpointReferenceType epr = AddressingUtils.createEndpointReference(transportURL,key);
	org.cagrid.introduce.tutorial.stockmanager.portfolio.stubs.types.StockPortfolioManagerReference ref = new org.cagrid.introduce.tutorial.stockmanager.portfolio.stubs.types.StockPortfolioManagerReference();
	ref.setEndpointReference(epr);
	return ref;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:14,代码来源:StockPortfolioManagerResourceHome.java

示例13: createWorkflow

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
public workflowmanagementfactoryservice.WMSOutputType createWorkflow(workflowmanagementfactoryservice.WMSInputType wMSInputElement) throws RemoteException, gov.nih.nci.cagrid.workflow.factory.stubs.types.WorkflowException {

	  TavernaWorkflowServiceImplResourceHome home = null;
		ResourceKey key = null;
		int TERM_TIME = 180;
		try {
			System.out.println("Creating a resource for the workflow..");
			Context ctx = new InitialContext();
			String lookupString = Constants.JNDI_SERVICES_BASE_NAME +
			"cagrid/TavernaWorkflowServiceImpl"+ "/home";
			home = (TavernaWorkflowServiceImplResourceHome) ctx.lookup(lookupString);

			key = home.createResource();

			//Create a resource on the Impl Service.
			TavernaWorkflowServiceImplResource workflowResource = home.getResource(key);

			EndpointReferenceType epr = AddressingUtils.createEndpointReference(ServiceHost
					.getBaseURL() + "cagrid/TavernaWorkflowServiceImpl", key);
			
			//If the Client sends a Termination time, use it. Otherwise use the default 180min.
			Calendar termTime = wMSInputElement.getTerminationTime();
			
			if(termTime == null){
				termTime = Calendar.getInstance();
		        termTime.add(Calendar.MINUTE, TERM_TIME);
			}
			workflowResource.setTerminationTime(termTime);
	        
			workflowResource.createWorkflow(wMSInputElement, threadExecutor);
			WMSOutputType wMSOutputElement = new WMSOutputType();
			wMSOutputElement.setWorkflowEPR(epr);
			return wMSOutputElement;
			
		} catch (Exception e1) {
			
			e1.printStackTrace();
			throw new RemoteException(e1.getLocalizedMessage());
		}
	}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:41,代码来源:TavernaWorkflowServiceImpl.java

示例14: getWorkflowResource

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
private TavernaWorkflowServiceImplResource getWorkflowResource() throws ResourceException, ResourceContextException {
	ResourceContext resourceContext = ResourceContext.getResourceContext();
	ResourceHome resourceHome = resourceContext.getResourceHome();
	ResourceKey resourceKey = resourceContext.getResourceKey();
	TavernaWorkflowServiceImplResource resource = (TavernaWorkflowServiceImplResource) resourceHome.find(resourceKey);
	return resource;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:8,代码来源:TavernaWorkflowServiceImplImpl.java

示例15: load

import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
public void load(ResourceKey resourceKey) throws ResourceException, NoSuchResourceException, InvalidResourceKeyException {
beingLoaded = true;
    //first we will recover the resource properties and initialize the resource
 TavernaWorkflowServiceImplResourceProperties props = (TavernaWorkflowServiceImplResourceProperties)resourcePropertyPersistenceHelper.load(TavernaWorkflowServiceImplResourceProperties.class, resourceKey.getValue());
    this.initialize(props, TavernaWorkflowServiceImplConstants.RESOURCE_PROPERTY_SET, resourceKey.getValue());
    
     //next we will recover the resource itself
     File file = resourcePersistenceHelper.getKeyAsFile(this.getClass(), resourceKey.getValue());
     if (!file.exists()) {
         beingLoaded = false;
         throw new NoSuchResourceException();
     }
     FileInputStream fis = null;
     int value = 0;
     try {
         fis = new FileInputStream(file);
         ObjectInputStream ois = new ObjectInputStream(fis);
         SubscriptionPersistenceUtils.loadSubscriptionListeners(
             this.getTopicList(), ois);
loadResource(resourceKey,ois);
     } catch (Exception e) {
         beingLoaded = false;
         throw new ResourceException("Failed to load resource", e);
     } finally {
         if (fis != null) {
             try { fis.close(); } catch (Exception ee) {}
         }
     } 
    
    beingLoaded = false;
 }
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:32,代码来源:TavernaWorkflowServiceImplResourceBase.java


注:本文中的org.globus.wsrf.ResourceKey类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。