Package org.jppf.node.protocol
Class ClassPathImpl
java.lang.Object
org.jppf.node.protocol.ClassPathImpl
- All Implemented Interfaces:
Serializable,Iterable<ClassPathElement>,ClassPath
A simple implementation of the
ClassPath interface- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Deprecated.thenameattribute has no clearly defined, consistent semantics.Add the specified element to this classpath.Add the specified element to this classpath.Add the specified element to this classpath.add(ClassPathElement element) Add the specified element to this classpath.Get a collection of all the classpath elements in this classpath.clear()Empty this classpath (remove all classpath elements).Deprecated.thenameattribute has no clearly defined, consistent semantics.booleanisEmpty()Determine whether this classpath is empty.booleanDetermine whether the node should force a reset of the class loader before executing the tasks.iterator()Deprecated.thenameattribute has no clearly defined, consistent semantics.remove(ClassPathElement element) Remove the specified element from this classpath.setForceClassLoaderReset(boolean forceClassLoaderReset) Specify whether the node should force a reset of the class loader before executing the tasks.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ClassPathImpl
public ClassPathImpl()
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<ClassPathElement>
-
add
Description copied from interface:ClassPathAdd the specified element to this classpath. -
add
Description copied from interface:ClassPathAdd the specified element to this classpath. When using this method, the local and remote locations are assumed to be the same. -
add
Description copied from interface:ClassPathAdd the specified element to this classpath. Upon processing by the node, the local location will be copied into the remote location. -
add
public ClassPath add(Location<?> sourceLocation, Location<?> targetLocation, boolean copyToExistingFileLocation) Description copied from interface:ClassPathAdd the specified element to this classpath. Upon processing by the node, the local location will be copied into the remote location, unless all of the following are true:- copyToExistingFile is
false - targetLocation is a
FileLocation - the file pointed to by targetLocation already exists on the file system
- Specified by:
addin interfaceClassPath- Parameters:
sourceLocation- the location of the element to add, in the client environment.targetLocation- the location of the element to add, in the node environment.copyToExistingFileLocation- whether to copy the source to the target if the target is either aFileLocationor anURLLocationwith afileURL protocol (e.g.file:/home/user/mylib.jar), and if it already exists on the file system.- Returns:
- this
ClassPath, for method call chaining.
- copyToExistingFile is
-
add
Deprecated.thenameattribute has no clearly defined, consistent semantics. It is no longer used.Add the specified element to this classpath. When using this method, the local and remote locations are assumed to be the same. -
add
Deprecated.thenameattribute has no clearly defined, consistent semantics. It is no longer used.Add the specified element to this classpath. Upon processing by the node, the source location will be copied into the target location.- Specified by:
addin interfaceClassPath- Parameters:
name- the the name of the element to add.localLocation- the location of the element to add, in the client environment.remoteLocation- the location of the element to add, in the node environment.- Returns:
- this
ClassPath, for method call chaining.
-
remove
Description copied from interface:ClassPathRemove the specified element from this classpath. -
remove
Deprecated.thenameattribute has no clearly defined, consistent semantics. It is no longer used.Remove the specified element from this classpath. -
clear
Description copied from interface:ClassPathEmpty this classpath (remove all classpath elements). -
element
Deprecated.thenameattribute has no clearly defined, consistent semantics. It is no longer used.Get the element with the specified name.- Specified by:
elementin interfaceClassPath- Parameters:
name- the name of the classpath element to find.- Returns:
- a
ClassPathElementinstance ornullif the element could no be found.
-
allElements
Description copied from interface:ClassPathGet a collection of all the classpath elements in this classpath.- Specified by:
allElementsin interfaceClassPath- Returns:
- a
CollectionofClassPathElements.
-
isEmpty
public boolean isEmpty()Description copied from interface:ClassPathDetermine whether this classpath is empty. -
isForceClassLoaderReset
public boolean isForceClassLoaderReset()Description copied from interface:ClassPathDetermine whether the node should force a reset of the class loader before executing the tasks.This only applies when this classpath is empty. If it is not empty, then the reset will occur regardless the value of this flag.
- Specified by:
isForceClassLoaderResetin interfaceClassPath- Returns:
trueif the class loader reset should be forced,falseotherwise.
-
setForceClassLoaderReset
Description copied from interface:ClassPathSpecify whether the node should force a reset of the class loader before executing the tasks.This only applies when this classpath is empty. If it is not empty, then the reset will occur regardless the value of the specified flag.
- Specified by:
setForceClassLoaderResetin interfaceClassPath- Parameters:
forceClassLoaderReset-trueif the class loader reset should be forced,falseotherwise.- Returns:
- this
ClassPath, for method call chaining.
-
toString
-
nameattribute has no clearly defined, consistent semantics.