org.eclipse.actf.validation.javapp.runtime
Class InterJvmResourceLocator

java.lang.Object
  extended by org.eclipse.actf.util.resources.DefaultResourceLocator
      extended by org.eclipse.actf.validation.javapp.runtime.InterJvmResourceLocator
All Implemented Interfaces:
IResourceLocator

public class InterJvmResourceLocator
extends DefaultResourceLocator

a resource locator for retrieving resource over a socket connection between two JVMs. This locator is used by the validating JVM (i.e. launched JVM) in an AOP-based validation. Resources are retrieved from the launching JVM, which is either launched by the Eclipse environment or via command line.

Note: The ClassLoader arguments are ignored in this implementation.

Author:
Mike Squillace

Field Summary
 
Fields inherited from interface org.eclipse.actf.util.resources.IResourceLocator
ACTF_RESOURCES_PATHS_KEY, DEFAULT_ACTF_RESOURCES_DIR
 
Constructor Summary
InterJvmResourceLocator()
           
 
Method Summary
protected  void finalize()
           
 InputStream getResourceAsStream(String id)
          get the resource with the given id as a stream and using the class loader that loaded this IResourceLocator instance.
 InputStream getResourceAsStream(String id, ClassLoader loader)
          get the resource corresponding to the given id as a stream using the specified class loader.
 InputStream getResourceAsStream(String id, String base, String ext, ClassLoader loader)
          get the resource corresponding to the given id as a stream using the specified class loader. The base path and extention of the file resource are also specified.
 IConfiguration requestConfiguration()
          request the active ACTF configuration object from the resource server
 void setHostName(String hostName)
          set the host name for the connection to the source of the resources to be retrieved by this locator
 void setPort(int port)
          set the port of the connection that will furnish the source of the resources to be retrieved by this locator
 
Methods inherited from class org.eclipse.actf.util.resources.DefaultResourceLocator
getPath, getPaths, getResource, getResourceAsBufferedStream, getResourceAsBufferedStream, getResources, makeBufferedStream
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterJvmResourceLocator

public InterJvmResourceLocator()
Method Detail

setHostName

public void setHostName(String hostName)
set the host name for the connection to the source of the resources to be retrieved by this locator

Parameters:
hostName - - the host name

setPort

public void setPort(int port)
set the port of the connection that will furnish the source of the resources to be retrieved by this locator

Parameters:
port -

getResourceAsStream

public InputStream getResourceAsStream(String id)
get the resource with the given id as a stream and using the class loader that loaded this IResourceLocator instance.

Specified by:
getResourceAsStream in interface IResourceLocator
Overrides:
getResourceAsStream in class DefaultResourceLocator
Parameters:
id - - id of resource
Returns:
input stream

getResourceAsStream

public InputStream getResourceAsStream(String id,
                                       ClassLoader loader)
get the resource corresponding to the given id as a stream using the specified class loader.

Specified by:
getResourceAsStream in interface IResourceLocator
Overrides:
getResourceAsStream in class DefaultResourceLocator
Parameters:
id - - id of resource
loader - -- class loader to use
Returns:
input stream

getResourceAsStream

public InputStream getResourceAsStream(String id,
                                       String base,
                                       String ext,
                                       ClassLoader loader)
get the resource corresponding to the given id as a stream using the specified class loader. The base path and extention of the file resource are also specified.

Specified by:
getResourceAsStream in interface IResourceLocator
Overrides:
getResourceAsStream in class DefaultResourceLocator
Parameters:
id - - id of resource
base - - base path
ext - -extentio
loader - -- class loader to use
Returns:
input streamn

requestConfiguration

public IConfiguration requestConfiguration()
                                    throws Exception
request the active ACTF configuration object from the resource server

Returns:
active ACTF configuration object
Throws:
Exception

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable