📄 mathresource.java
字号:
package org.globus.examples.services.core.rl.impl;import java.util.Calendar;import org.globus.wsrf.Resource;import org.globus.wsrf.ResourceIdentifier;import org.globus.wsrf.ResourceProperties;import org.globus.wsrf.ResourceLifetime;import org.globus.wsrf.ResourceProperty;import org.globus.wsrf.ResourcePropertySet;import org.globus.wsrf.impl.SimpleResourcePropertyMetaData;import org.globus.wsrf.impl.SimpleResourcePropertySet;import org.globus.wsrf.impl.ReflectionResourceProperty;public class MathResource implements Resource, ResourceIdentifier, ResourceProperties, ResourceLifetime { /* Resource Property set */ private ResourcePropertySet propSet; /* Resource key. This uniquely identifies this resource. */ private Object key; /* Resource properties */ private int value; private String lastOp; private Calendar terminationTime; /* Initializes RPs and returns a unique identifier for this resource */ public Object initialize() throws Exception { this.key = new Integer(hashCode()); this.propSet = new SimpleResourcePropertySet( MathQNames.RESOURCE_PROPERTIES); try { ResourceProperty valueRP = new ReflectionResourceProperty( MathQNames.RP_VALUE, "Value", this); this.propSet.add(valueRP); setValue(0); ResourceProperty lastOpRP = new ReflectionResourceProperty( MathQNames.RP_LASTOP, "LastOp", this); this.propSet.add(lastOpRP); setLastOp("NONE"); ResourceProperty termTimeRP = new ReflectionResourceProperty( SimpleResourcePropertyMetaData.TERMINATION_TIME, this); this.propSet.add(termTimeRP); ResourceProperty currTimeRP = new ReflectionResourceProperty( SimpleResourcePropertyMetaData.CURRENT_TIME, this); this.propSet.add(currTimeRP); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } return key; } /* Get/Setters for the RPs */ public int getValue() { return value; } public void setValue(int value) { this.value = value; } public String getLastOp() { return lastOp; } public void setLastOp(String lastOp) { this.lastOp = lastOp; } /* Required by interface ResourceProperties */ public ResourcePropertySet getResourcePropertySet() { return this.propSet; } /* Required by interface ResourceIdentifier */ public Object getID() { return this.key; } /* Required by interface ResourceLifetime */ public Calendar getCurrentTime() { return Calendar.getInstance(); } public Calendar getTerminationTime() { return this.terminationTime; } public void setTerminationTime(Calendar terminationTime) { this.terminationTime=terminationTime; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -