Skip to content

Package: EMFFormsViewServiceManager

EMFFormsViewServiceManager

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.core.services.view;
15:
16: import java.util.Set;
17:
18: import org.eclipse.emfforms.common.Optional;
19:
20: /**
21: * This Factory provides access methods to retrieve a service of a specific scope.
22: *
23: * @author Eugen Neufeld
24: * @since 1.8
25: * @noextend This interface is not intended to be extended by clients.
26: * @noimplement This interface is not intended to be implemented by clients.
27: */
28: public interface EMFFormsViewServiceManager {
29:
30:         /**
31:          * Return a local service which should be activated immediately. If no service of the requested type is available
32:          * null will be returned.
33:          *
34:          * @param <T> The type parameter of the service
35:          * @param type The Type of the requested service
36:          * @param emfFormsViewContext The {@link EMFFormsViewContext} to use
37:          * @return An optional instance of the requested service registered for this scope.
38:          */
39:         <T> Optional<T> createLocalImmediateService(Class<T> type, EMFFormsViewContext emfFormsViewContext);
40:
41:         /**
42:          * Return a local service which should be activated on request. If no service of the requested type is available
43:          * null will be returned.
44:          *
45:          * @param <T> The type parameter of the service
46:          * @param type The Type of the requested service
47:          * @param emfFormsViewContext The {@link EMFFormsViewContext} to use
48:          * @return An optional instance of the requested service registered for this scope.
49:          */
50:         <T> Optional<T> createLocalLazyService(Class<T> type, EMFFormsViewContext emfFormsViewContext);
51:
52:         /**
53:          * Return a global service which should be activated immediately. If no service of the requested type is available
54:          * null will be returned.
55:          *
56:          * @param <T> The type parameter of the service
57:          * @param type The Type of the requested service
58:          * @param emfFormsViewContext The {@link EMFFormsViewContext} to use
59:          * @return An optional instance of the requested service registered for this scope.
60:          */
61:         <T> Optional<T> createGlobalImmediateService(Class<T> type, EMFFormsViewContext emfFormsViewContext);
62:
63:         /**
64:          * Return a global service which should be activated on request. If no service of the requested type is available
65:          * null will be returned.
66:          *
67:          * @param <T> The type parameter of the service
68:          * @param type The Type of the requested service
69:          * @param emfFormsViewContext The {@link EMFFormsViewContext} to use
70:          * @return An optional instance of the requested service registered for this scope.
71:          */
72:         <T> Optional<T> createGlobalLazyService(Class<T> type, EMFFormsViewContext emfFormsViewContext);
73:
74:         /**
75:          * Returns all registered services which are global immediate ordered by the priority.
76:          *
77:          * @return The Set of all services which are global immediate. This set cannot be null
78:          */
79:         Set<Class<?>> getAllGlobalImmediateServiceTypes();
80:
81:         /**
82:          * Returns all registered services which are local immediate ordered by the priority.
83:          *
84:          * @return The Set of all services which are local immediate. This set cannot be null
85:          */
86:         Set<Class<?>> getAllLocalImmediateServiceTypes();
87: }