mathresource.java

来自「globus toolkit Math例子」· Java 代码 · 共 74 行

JAVA
74
字号
package org.globus.examples.services.core.factory.impl;import org.globus.wsrf.Resource;import org.globus.wsrf.ResourceIdentifier;import org.globus.wsrf.ResourceProperties;import org.globus.wsrf.ResourceProperty;import org.globus.wsrf.ResourcePropertySet;import org.globus.wsrf.impl.SimpleResourcePropertySet;import org.globus.wsrf.impl.ReflectionResourceProperty;public class MathResource implements Resource, ResourceIdentifier,		ResourceProperties {	/* Resource Property set */	private ResourcePropertySet propSet;	/* Resource key. This uniquely identifies this resource. */	private Object key;	/* Resource properties */	private int value;	private String lastOp;	/* 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");		} 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;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?