[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Globus-discuss] Question about Operation Provider and Resource Properties Model in GT4



Hi, Junji

Thank you for your comment and sample code.

I have not tried your code yet.
But, I think an operation provider's instance is created just once on a
container. So, if you use an operation provider's instance to create
ResourceProperty like following, multiple wsrf services will share the
instance.
>	ResourceProperty termTimeRP = new ReflectionResourceProperty(
>		SimpleResourcePropertyMetaData.TERMINATION_TIME, this);

I think ResourceProperty's instance should be created in Factory model.
But currently, there is no way to create Operation Provider's resources
in Factory model, I think.



On Sat, 13 May 2006 01:21:35 +0900
Junji Sawada <junjis@xxxxxxxx> wrote:

> Hi,
> 
> On 2006/05/11, at 19:15, Kohei Ichikawa wrote:
> 
> > I think operation provider's resource properties implementation should
> > be provided by operation provider's developer.
> > I'm now trying to develop an operation provider which contains  
> > resource
> > properties. But, I don't want to make developers who want to use this
> > operation provider to know internal implementation of this operation
> > provider's resources.
> >
> > Anyone has good idea about this problem?
> 
> I think that operation provider registers resource properties in  
> first time when he is called.
> 
> below is sample providing SetTerminationTime operation(but not  
> tested :-p)
> 
> public class MySetTerminationTimeProvider {
> 
> 	private Calendar terminationTime;
> 
> 	public SetTerminationTimeResponse setTerminationTime 
> (SetTerminationTime request) {
> 		ResourceContext ctx = ResourceContext.getResourceContext();
> 		ResourceHome home = ctx.getResourceHome();
> 		ResourceKey key = ctx.getResourceKey();
> 		Object resource = home.find(key);
> 
> 		// check whether Resource Property is registered
> 		ResourcePropertySet propSet = ((ResourceProperties) 
> resource).getResourcePropertySet();
> 		ResourceProperty prop = propSet.get 
> (SimpleResourcePropertyMetaData.TERMINATION_TIME);
> 		if (prop == null) {
> 			// Resource Property is not registered. register it
> 			ResourceProperty termTimeRP = new ReflectionResourceProperty(
> 				SimpleResourcePropertyMetaData.TERMINATION_TIME, this);
> 			propSet.add(termTimeRP);
> 
> 			ResourceProperty currTimeRP = new ReflectionResourceProperty(
> 				SimpleResourcePropertyMetaData.CURRENT_TIME, this);
> 			propSet.add(currTimeRP);
> 		}
> 		// do operation...
> 	}
> 	
> 	public Calendar getCurrentTime() {
> 		return Calendar.getInstance();
> 	}
> 
> 	public Calendar getTerminationTime() {
> 		return this.terminationTime;
> 	}
> 
> 	public void setTerminationTime(Calendar terminationTime) {
> 		this.terminationTime=terminationTime;
> 	}
> }
> 
> -
> To Unsubscribe: send mail to majordomo@xxxxxxxxxx
> with "unsubscribe discuss" in the body of the message

-- 
Kohei Ichikawa
<ichikawa@xxxxxxxxxxxxxxxxxxxxx>
Graduate School of Information Science and Technology,
Osaka University

-
To Unsubscribe: send mail to majordomo@xxxxxxxxxx
with "unsubscribe discuss" in the body of the message