Interface IV8ProjectManager
-
- All Superinterfaces:
IManagedService
public interface IV8ProjectManager extends IManagedService
The entry point for accessing known V8 projects and their project-specific managers. The manager may return projects by some filters, such as project type or return V8 project by some metadata context.Also, clients may register listeners to listen to V8 project changes:
- V8 project properties changes: project version, compatibility mode, script variant, etc.
- V8 project relations and dependencies changes.
- V8 project lifecycle changes: new V8 project creation or deletion.
In order to create specific V8 projects or perform project-level alterations of V8 projects, clients must use the corresponding project-specific managers.
- See Also:
IV8Project
- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SERVICE_NAME
Service name.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addProjectListener(org.eclipse.core.resources.IProject project, IEventListener listener, Class<? extends IV8ProjectEvent> eventType)
Adds the specified V8 project properties listener.void
addProjectsListener(IEventListener listener, Class<? extends IV8ProjectEvent> eventType)
Adds the specified V8 project properties listener.IV8Project
getProject(IDtProject project)
Returns the V8 project by the specifiedIDtProject
.IV8Project
getProject(String name)
Returns the V8 project with the specified project name.IV8Project
getProject(org.eclipse.core.resources.IProject project)
Returns the V8 project by the specified workspaceIProject
.IV8Project
getProject(org.eclipse.emf.common.util.URI context)
Returns the V8 project by the specified context metadataURI
.IV8Project
getProject(org.eclipse.emf.ecore.EObject context)
Returns a V8 project by the specified context metadata object.Collection<IV8Project>
getProjects()
Returns all known V8 projects.<T extends IV8Project>
Collection<T>getProjects(Class<T> projectType)
Returns all known V8 projects of the the specified project type.Collection<IV8Project>
getProjects(Predicate<IV8Project> filter)
Returns all known V8 projects filtered by the providedfilter
.<T extends IProjectSpecificManager>
TgetProjectSpecificManager(IV8Project v8project, Class<T> managerType)
Returns the project-specific manager dealing with the specified V8 project.boolean
isServiceContextActive(IV8Project project)
Checks if the service context (ProjectContext
is active at the moment.boolean
isServiceContextActive(org.eclipse.core.resources.IProject project)
Checks if the service context (ProjectContext
is active at the moment.void
removeListener(IEventListener listener)
Removes a previously registered event listener (regardless of the kind of events it listened to).-
Methods inherited from interface com._1c.g5.wiring.IManagedService
activate, deactivate
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
Service name. May be used in service recovery or service lifecycle orchestration.- See Also:
- Constant Field Values
-
-
Method Detail
-
getProjects
Collection<IV8Project> getProjects()
Returns all known V8 projects. The returned collection is immutable.- Returns:
- all known V8 projects, never
null
-
getProjects
Collection<IV8Project> getProjects(Predicate<IV8Project> filter)
Returns all known V8 projects filtered by the providedfilter
. The returned collection is immutable.- Parameters:
filter
- the filter to filter V8 projects, cannot benull
- Returns:
- all known V8 projects filtered by the provided
filter
, nevernull
-
getProjects
<T extends IV8Project> Collection<T> getProjects(Class<T> projectType)
Returns all known V8 projects of the the specified project type. The returned collection is immutable.- Parameters:
projectType
- a type of the V8 project, cannot benull
- Returns:
- all known V8 projects of the specified project type.
-
getProject
IV8Project getProject(String name)
Returns the V8 project with the specified project name. May returnnull
if there is no V8 project known with the given name.- Parameters:
name
- the name of V8 project to get, cannot benull
- Returns:
- the V8 project with the given project name or
null
if not found
-
getProject
IV8Project getProject(org.eclipse.core.resources.IProject project)
Returns the V8 project by the specified workspaceIProject
. May returnnull
if there is no V8 project with the given workspace project.- Parameters:
project
- the workspace project of V8 project to get, cannot benull
- Returns:
- the V8 project with the given project workspace project or
null
if not found
-
getProject
IV8Project getProject(org.eclipse.emf.ecore.EObject context)
Returns a V8 project by the specified context metadata object. The returned project will contain the given context object. May returnnull
if there is no V8 project containing the given context object.- Parameters:
context
- the context metadata object, cannot benull
- Returns:
- the V8 project with the given metadata object or
null
if not found
-
getProject
IV8Project getProject(org.eclipse.emf.common.util.URI context)
Returns the V8 project by the specified context metadataURI
. The returned project will contain the metadata object with the givenURI
. May returnnull
if there is no V8 project containing the given context object.- Parameters:
context
- the context metadata objectURI
, cannot benull
- Returns:
- the V8 project with the given metadata object
URI
ornull
if not found
-
getProject
IV8Project getProject(IDtProject project)
Returns the V8 project by the specifiedIDtProject
.- Parameters:
project
- The targetIDtProject
handle, cannot benull
- Returns:
- the V8 project with the given DT project or
null
if not found
-
getProjectSpecificManager
<T extends IProjectSpecificManager> T getProjectSpecificManager(IV8Project v8project, Class<T> managerType)
Returns the project-specific manager dealing with the specified V8 project.Notice that if the type of a V8 project is known in the client code, it is perfectly safe to directly inject the instance of the specific manager to work with that V8 project.
This method is primarily intended to deal with higher-level specific managers, for example, when the client code is used for a certain subset of V8 projects such that all their specific managers implement a common specific interface. In this situation, the client is ensured to obtain the correct specific manager using this method.
- Type Parameters:
T
- the manager type- Parameters:
v8project
- the V8 project to get its specific manager for, notnull
managerType
- the required class- Returns:
- the project-specific manager of the specified type or
null
if no project-specific manager of the required type is known for the specified V8 project
-
addProjectListener
void addProjectListener(org.eclipse.core.resources.IProject project, IEventListener listener, Class<? extends IV8ProjectEvent> eventType)
Adds the specified V8 project properties listener. The listener will be notified about the provided V8project
changes, based on the provided event type: lifecycle, dependencies or properties changes, such as project version, compatibility mode, script variant, etc.The listener may be later removed with
removeListener(IEventListener)
method.- Parameters:
project
- the project to add listener for, cannot benull
listener
- the listener to add, cannot benull
eventType
- the event type to listen, cannot benull
- See Also:
IV8ProjectEvent
-
addProjectsListener
void addProjectsListener(IEventListener listener, Class<? extends IV8ProjectEvent> eventType)
Adds the specified V8 project properties listener. The listener will be notified about all known V8 projects changes, based on the provided event type: lifecycle, dependencies or properties changes, such as project version, compatibility mode, script variant, etc.The listener may be later removed with
removeListener(IEventListener)
method.- Parameters:
listener
- the listener to add, cannot benull
eventType
- the event type to listen, cannot benull
- See Also:
IV8ProjectEvent
-
removeListener
void removeListener(IEventListener listener)
Removes a previously registered event listener (regardless of the kind of events it listened to).- Parameters:
listener
- the listener to remove, cannot benull
-
isServiceContextActive
boolean isServiceContextActive(IV8Project project)
Checks if the service context (ProjectContext
is active at the moment. Could be used by other non-LC aware services/clients to check the ability to work with the project service infrastructure.- Parameters:
project
- The project to check context activity for, cannot benull
- Returns:
- True if the context is active; false otherwise
-
isServiceContextActive
boolean isServiceContextActive(org.eclipse.core.resources.IProject project)
Checks if the service context (ProjectContext
is active at the moment. Could be used by other non-LC aware services/clients to check the ability to work with the project service infrastructure.- Parameters:
project
- The project to check context activity for, cannot benull
- Returns:
- True if the context is active; false otherwise
-
-