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

jadex.platform.service.remote.ProxyReference Maven / Gradle / Ivy

Go to download

The Jadex platform package contains implementations of platform services as well as the platform component itself.

There is a newer version: 3.0.117
Show newest version
package jadex.platform.service.remote;


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

import jadex.commons.transformation.annotations.Alias;

/**
 *  A proxy reference is the transfer format of a remote reference which should
 *  be made to a proxy on the other side.
 */
@Alias("jadex.base.service.remote.ProxyReference")
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;
	}

	//-------- 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