Package com._1c.g5.v8.dt.core.lifecycle
Class ProjectContext
- java.lang.Object
-
- com._1c.g5.v8.dt.core.lifecycle.AbstractDtProjectContext
-
- com._1c.g5.v8.dt.core.lifecycle.ProjectContext
-
- All Implemented Interfaces:
ILifecycleContext
public final class ProjectContext extends AbstractDtProjectContext
Lifecycle management service context matching the project in the workspace.
-
-
Constructor Summary
Constructors Constructor Description ProjectContext(IDtProject project)
Creates the project context.ProjectContext(IDtProject project, Object extraData, ProjectStartType startType)
Creates the project context for the 'Start' phase.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Object
getCustomServiceContext(String name)
Gets the custom context being set for a specific service identified by it's unuqie name.Object
getExtraData()
Gets the extra data.IDtProject
getProject()
Gets the project.ProjectStartType
getStartType()
Gets the type of the project start (if context is applied during the service start phase).ProjectStopType
getStopType()
Gets the type of the project stop (if context is applied during the service stop phase).int
hashCode()
boolean
isFailureRestoration()
Checks if the failure restoration mode is enabledvoid
putCustomServiceContext(String name, Object context)
Adds custom service context for the given service.void
setFailureRestoration(boolean failureRestoration)
Sets the failure restoration modevoid
setStartType(ProjectStartType startType)
Sets the probject start type.void
setStopType(ProjectStopType stopType)
Sets the project stop type.String
toString()
-
Methods inherited from class com._1c.g5.v8.dt.core.lifecycle.AbstractDtProjectContext
addNatures, getNatures, hasNature
-
-
-
-
Constructor Detail
-
ProjectContext
public ProjectContext(IDtProject project)
Creates the project context.- Parameters:
project
- The target project for the service lifecycle change operation. Cannot benull
.
-
ProjectContext
public ProjectContext(IDtProject project, Object extraData, ProjectStartType startType)
Creates the project context for the 'Start' phase.- Parameters:
project
- The target project for the service lifecycle change operation. Cannot benull
.extraData
- Extra data. Can benull
.startType
- The type of the project start.
-
-
Method Detail
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractDtProjectContext
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDtProjectContext
-
getProject
public IDtProject getProject()
Gets the project.- Overrides:
getProject
in classAbstractDtProjectContext
- Returns:
- the project.
-
getExtraData
public Object getExtraData()
Gets the extra data.- Returns:
- the extra data if any.
-
getCustomServiceContext
public Object getCustomServiceContext(String name)
Gets the custom context being set for a specific service identified by it's unuqie name.- Parameters:
name
- The name of the service.- Returns:
- The custom context being set for the service.
-
getStartType
public ProjectStartType getStartType()
Gets the type of the project start (if context is applied during the service start phase). Allows to manage the project intialization strategy - do clean rebuild, restoration of the previous state or new project creation.- Returns:
- The type of the project start. Can be
null
-
getStopType
public ProjectStopType getStopType()
Gets the type of the project stop (if context is applied during the service stop phase). Allows to manage the project deintialization strategy - do context state saving or deleting.- Returns:
- The type of the project start. Can be
null
-
putCustomServiceContext
public void putCustomServiceContext(String name, Object context)
Adds custom service context for the given service. The custom context can be used by this service to further affect it's logic during the state change operations.- Parameters:
name
- The name of the service. Can't benull
context
- The custom service context. Can't benull
-
setStartType
public void setStartType(ProjectStartType startType)
Sets the probject start type.- Parameters:
startType
- The start type of the project. Can benull
.
-
setStopType
public void setStopType(ProjectStopType stopType)
Sets the project stop type.- Parameters:
stopType
- The stop type of the project. Can benull
.
-
isFailureRestoration
public boolean isFailureRestoration()
Checks if the failure restoration mode is enabled- Returns:
- True if the failure restoration mode is enabled
-
setFailureRestoration
public void setFailureRestoration(boolean failureRestoration)
Sets the failure restoration mode- Parameters:
failureRestoration
- Set true to enabled failure restoration mode. Set false to reset it
-
-