本文整理汇总了Java中org.globus.wsrf.ResourceKey类的典型用法代码示例。如果您正苦于以下问题:Java ResourceKey类的具体用法?Java ResourceKey怎么用?Java ResourceKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceKey类属于org.globus.wsrf包,在下文中一共展示了ResourceKey类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: loadResource
import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
public void loadResource(ResourceKey resourceKey, ObjectInputStream ois) throws Exception {
if(super.getWorkflowStatusElement().equals(WorkflowStatusType.Done)){
try {
this.setOutputDoc((WorkflowPortType[]) ois.readObject());
this.setWorkflowStatus(super.getWorkflowStatusElement());
System.out.println("loadResource was called..");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:14,代码来源:TavernaWorkflowServiceImplResource.java
示例17: 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 gov.nih.nci.cagrid.workflow.service.impl.stubs.types.TavernaWorkflowServiceImplReference 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 += "TavernaWorkflowServiceImpl";
EndpointReferenceType epr = AddressingUtils.createEndpointReference(transportURL,key);
gov.nih.nci.cagrid.workflow.service.impl.stubs.types.TavernaWorkflowServiceImplReference ref = new gov.nih.nci.cagrid.workflow.service.impl.stubs.types.TavernaWorkflowServiceImplReference();
ref.setEndpointReference(epr);
return ref;
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:14,代码来源:TavernaWorkflowServiceImplResourceHome.java
示例18: createEnumerationResponse
import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
public static EnumerationResponseContainer createEnumerationResponse(EnumIterator enumIter)
throws EnumerationCreationException {
try {
EnumResourceHome resourceHome = EnumResourceHome.getEnumResourceHome();
VisibilityProperties visibility = new VisibilityProperties(
"cagrid/" + WsEnumConstants.CAGRID_ENUMERATION_SERVICE_NAME, null);
EnumResource resource = resourceHome.createEnumeration(
enumIter, visibility, false);
ResourceKey key = resourceHome.getKey(resource);
EnumerationContextType enumContext =
EnumProvider.createEnumerationContextType(key);
URL baseURL = ServiceHost.getBaseURL();
String serviceURI = baseURL.toString()
+ "cagrid/" + WsEnumConstants.CAGRID_ENUMERATION_SERVICE_NAME;
EndpointReferenceType epr =
AddressingUtils.createEndpointReference(serviceURI, key);
EnumerationResponseContainer container = new EnumerationResponseContainer();
container.setContext(enumContext);
container.setEPR(epr);
return container;
} catch (Exception ex) {
throw new EnumerationCreationException(ex.getMessage(), ex);
}
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:30,代码来源:EnumerateResponseFactory.java
示例19: stage
import org.globus.wsrf.ResourceKey; //导入依赖的package包/类
public void stage(DataDescriptor dd, DataStagedCallback callback)
throws Exception {
setDataStagedCallback(callback);
File storageFile = new File(getStorageDirectory().getAbsolutePath()
+ File.separator + (String) getID() + ".cache");
DataStorageDescriptor desc = new DataStorageDescriptor();
try {
// get the resource home of the caller
MessageContext ctx = MessageContext.getCurrentContext();
String servicePath = ctx.getTargetService();
String jndiName = Constants.JNDI_SERVICES_BASE_NAME + servicePath
+ "/home";
desc.setCreatorResourceHomeJNDI(jndiName);
ResourceKey key = ResourceContext.getResourceContext()
.getResourceKey();
if (key != null) {
desc.setCreatorResourceKeyName(key.getName().toString());
desc.setCreatorResourceKeyValue((String) key.getValue());
}
} catch (Exception e) {
e.printStackTrace();
}
desc.setLocation(storageFile.getAbsolutePath());
if (SecurityUtils.getCallerIdentity() != null) {
desc.setUserDN(SecurityUtils.getCallerIdentity());
}
desc.setDataDescriptor(dd);
desc.setStatus(Status.Staging);
desc.setDeleteOnDestroy(shouldDeleteFileOnDestroyDefault);
setDataStorageDescriptor(desc);
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:35,代码来源:TransferServiceContextResource.java
示例20: 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.transfer.context.stubs.types.TransferServiceContextReference 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 += "TransferServiceContext";
EndpointReferenceType epr = AddressingUtils.createEndpointReference(transportURL,key);
org.cagrid.transfer.context.stubs.types.TransferServiceContextReference ref = new org.cagrid.transfer.context.stubs.types.TransferServiceContextReference();
ref.setEndpointReference(epr);
return ref;
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:14,代码来源:TransferServiceContextResourceHome.java
注:本文中的org.globus.wsrf.ResourceKey类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论