Class AutoOperation
- java.lang.Object
-
- org.glassfish.deployment.autodeploy.AutoOperation
-
- Direct Known Subclasses:
AutoDeploymentOperation
,AutoUndeploymentOperation
@Service @PerLookup public abstract class AutoOperation extends Object
Abstract class for operations the AutoDeployer can perform (currently deploy and undeploy).AutoOperation and its subclasses have no-arg constructors so they can be initialized as services and an init method that accepts what might otherwise be constructor arguments.
- Author:
- tjquinn
-
-
Field Summary
Fields Modifier and Type Field Description static Logger
deplLogger
-
Constructor Summary
Constructors Constructor Description AutoOperation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
deleteAllMarks(File file)
Deletes all possible marker files for the file.protected File
getDeployedFile(File file)
Returns a File object for the "deployed" marker file for a given file.protected File
getDeployFailedFile(File file)
Returns a File object for the "deploy failed" marker file for a given file.protected abstract String
getMessageString(AutoDeployer.AutodeploymentStatus ds, File file)
Returns the appropriate message string for the given operation and the outcome.protected File
getUndeployedFile(File file)
Returns a File object for the "undeployed" marker file for a given file.protected File
getUndeployFailedFile(File file)
Returns a File object for the "undeploy failed" marker file for a given file.protected abstract void
markFiles(AutoDeployer.AutodeploymentStatus ds, File file)
Marks the files relevant to the specified file appropriately given the outcome of the command as given in the status.AutoDeployer.AutodeploymentStatus
run()
Executes the operation
-
-
-
Field Detail
-
deplLogger
public static final Logger deplLogger
-
-
Method Detail
-
run
public final AutoDeployer.AutodeploymentStatus run() throws AutoDeploymentException
Executes the operation- Returns:
- true/false depending on the outcome of the operation
- Throws:
AutoDeploymentException
-
markFiles
protected abstract void markFiles(AutoDeployer.AutodeploymentStatus ds, File file)
Marks the files relevant to the specified file appropriately given the outcome of the command as given in the status.- Parameters:
ds
- AutodeploymentStatus indicating the outcome of the operationfile
- file of interest
-
getMessageString
protected abstract String getMessageString(AutoDeployer.AutodeploymentStatus ds, File file)
Returns the appropriate message string for the given operation and the outcome.- Parameters:
ds
- AutodeploymentStatus value giving the outcome of the operationfile
- file of interest- Returns:
- message string to be logged
-
getDeployedFile
protected File getDeployedFile(File file)
Returns a File object for the "deployed" marker file for a given file.- Parameters:
file
-- Returns:
- File for the "deployed" marker file
-
getDeployFailedFile
protected File getDeployFailedFile(File file)
Returns a File object for the "deploy failed" marker file for a given file.- Parameters:
file
-- Returns:
- File for the "deploy failed" marker file
-
getUndeployedFile
protected File getUndeployedFile(File file)
Returns a File object for the "undeployed" marker file for a given file.- Parameters:
file
-- Returns:
- File for the "undeployed" marker file
-
getUndeployFailedFile
protected File getUndeployFailedFile(File file)
Returns a File object for the "undeploy failed" marker file for a given file.- Parameters:
file
-- Returns:
- File for the "undeploy failed" marker file
-
deleteAllMarks
protected void deleteAllMarks(File file)
Deletes all possible marker files for the file.- Parameters:
file
- the File whose markers should be removed
-
-