All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bridge.component.impl.remotecommands.ProxyReference Maven / Gradle / Ivy

Go to download

Jadex bridge is a base package for kernels and platforms, i.e., it is used by both and provides commonly used interfaces and classes for active components and their management.

There is a newer version: 4.0.267
Show newest version
package jadex.bridge.component.impl.remotecommands;


import java.util.HashMap;
import java.util.Map;

/**
 *  A proxy reference is the transfer format of a remote reference which should
 *  be made to a proxy on the other side.
 */
public class ProxyReference
{
	//-------- attributes --------
	
	/** The proxy info. */
	protected ProxyInfo pi;
	
	/** The remote reference. */
	protected RemoteReference rr;
	
	/** The value cache. */
	protected Map cache;
		
	//-------- constructors --------
	
	/**
	 *  Create a new proxy reference.
	 */
	public ProxyReference()
	{
	}

	/**
	 *  Create a new proxy reference.
	 */
	public ProxyReference(ProxyInfo pi, RemoteReference rr)
	{
		this.pi = pi;
		this.rr = rr;
//		System.out.println("ProxyReference: "+getRemoteReference().getRemoteComponent()+" "+getRemoteReference().getTargetIdentifier());
	}

	//-------- methods --------
	
	/**
	 *  Get the proxy info.
	 *  @return The proxy info.
	 */
	public ProxyInfo getProxyInfo()
	{
		return pi;
	}

	/**
	 *  Set the pi.
	 *  @param pi The pi to set.
	 */
	public void setProxyInfo(ProxyInfo pi)
	{
		this.pi = pi;
	}

	/**
	 *  Get the remoteReference.
	 *  @return the remoteReference.
	 */
	public RemoteReference getRemoteReference()
	{
		return rr;
	}

	/**
	 *  Set the remote reference.
	 *  @param remote reference The remote reference to set.
	 */
	public void setRemoteReference(RemoteReference remoteReference)
	{
		this.rr = remoteReference;
	}
	
	/**
	 *  Get the cached values.
	 *  @return The cached values. 
	 */
	public Map getCache()
	{
		return cache;
	}

	/**
	 *  Set the cached values.
	 *  @param cache The cached values. 
	 */
	public void setCache(Map cache)
	{
		this.cache = cache;
	}
	
	/**
	 *  Get the cached values.
	 */
	public void putCache(String key, Object value)
	{
		if(cache==null)
			cache = new HashMap();
		cache.put(key, value);
	}
	
	/**
	 *  Get the string representation.
	 *  @return The string representation.
	 */
	public String toString()
	{
		return "ProxyReference(reference="+rr+", cache="+cache+", info="+pi+")";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy