File tree Expand file tree Collapse file tree
weaverbird-core/src/main/java/com/techsenger/weaverbird/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717package com .techsenger .weaverbird .core .api ;
1818
19+ import com .techsenger .toolkit .core .version .Version ;
1920import com .techsenger .weaverbird .core .api .registry .Registry ;
2021import com .techsenger .weaverbird .core .spi .repo .RepoService ;
21- import com .techsenger .toolkit .core .version .Version ;
2222
2323/**
2424 *
@@ -36,6 +36,11 @@ public interface Framework {
3636 */
3737 FrameworkSettings getSettings ();
3838
39+ /**
40+ * Returns the framework context.
41+ */
42+ FrameworkContext getContext ();
43+
3944 /**
4045 * Returns the component manager.
4146 */
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2018-2026 Pavel Castornii.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .techsenger .weaverbird .core .api ;
18+
19+ import java .util .Map ;
20+
21+ /**
22+ * This context is used by application developers.
23+ *
24+ * @author Pavel Castornii
25+ */
26+ public interface FrameworkContext {
27+
28+ /**
29+ * Returns a thread-safe map of properties.
30+ */
31+ Map <Object , Object > getProperties ();
32+ }
Original file line number Diff line number Diff line change 2222import com .techsenger .weaverbird .core .api .Constants ;
2323import com .techsenger .weaverbird .core .api .DefaultPathManager ;
2424import com .techsenger .weaverbird .core .api .Framework ;
25+ import com .techsenger .weaverbird .core .api .FrameworkContext ;
2526import com .techsenger .weaverbird .core .api .FrameworkSettings ;
2627import com .techsenger .weaverbird .core .api .JvmInspector ;
2728import com .techsenger .weaverbird .core .api .LogManager ;
@@ -52,6 +53,8 @@ public class DefaultFramework implements Framework {
5253
5354 private final FrameworkSettings settings ;
5455
56+ private final FrameworkContext context = new DefaultFrameworkContext ();
57+
5558 /**
5659 * Log manager.
5760 */
@@ -119,6 +122,11 @@ public FrameworkSettings getSettings() {
119122 return settings ;
120123 }
121124
125+ @ Override
126+ public FrameworkContext getContext () {
127+ return context ;
128+ }
129+
122130 @ Override
123131 public Version getVersion () {
124132 return ProjectInfo .getVersion ();
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2018-2026 Pavel Castornii.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .techsenger .weaverbird .core .impl ;
18+
19+ import com .techsenger .weaverbird .core .api .FrameworkContext ;
20+ import java .util .Map ;
21+ import java .util .concurrent .ConcurrentHashMap ;
22+
23+ /**
24+ *
25+ * @author Pavel Castornii
26+ */
27+ public class DefaultFrameworkContext implements FrameworkContext {
28+
29+ private final Map <Object , Object > properties = new ConcurrentHashMap <>();
30+
31+ @ Override
32+ public Map <Object , Object > getProperties () {
33+ return properties ;
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments