You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-23Lines changed: 29 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
Demonstration of Declarative Services (DS) in OSGi JVM servers
3
3
4
4
## Preface
5
-
This example shows how OSGi Declarative Services (DS) can be used in an OSGi JVM server to perform application component refresh (change of, or fix to, implementations) without loss of service. Declarative Services removes the need for boilerplate tracking code such as ServiceTrackers, and by moving to a service component architecture from bundle-wiring (Import-Package) you gain all the dynamic refresh and look-up benefits of services. DS handles all the injection of components into your application, and ensures that if a service (or implementation) is removed it can seamlessly switch to a replacement (or updated) service.
5
+
This example shows how OSGi Declarative Services (DS) can be used in an OSGi JVM server to perform application component refresh (change of, or fix to, implementations) without loss of service. Declarative Services removes the need for boilerplate tracking code such as ServiceTrackers, and by moving to a service component architecture from OSGi bundle-wiring (Import-Package) you gain all the dynamic refresh and look-up benefits of services. DS handles all the injection of components into your application, and ensures that if a service (or implementation) is removed it can seamlessly switch to a replacement (or updated) service.
6
6
7
7
There are 8 projects in this simple sample (4 OSGi projects, and each has a corresponding CICS bundle project). This same architecture can be used for complex applications.
8
8
@@ -28,38 +28,44 @@ The second implementation, version 1.1.0, uses a CICS TSQ to store data, using t
28
28
29
29
In our example we follow the scenario that we have the base application running using the in-memory storage service and we now want to upgrade to the new TSQ storage service.
30
30
31
-
When we first install the new bundle, the TSQ storage service will activate, but the CICS App will remain bound to the in-memory implementation. We can then disable the in-memory implementation. At which point OSGi declarative services will bind the new TSQ service and unbind the in-memory service (in that order). This means the CICS App is never left without a working implementation and therefore avoiding loss of service.
31
+
When we first install the new CICS bundle, the TSQ storage service will activate, but the CICS App will remain bound to the in-memory implementation. We can then disable the in-memory implementation. At which point OSGi declarative services will bind the new TSQ service and unbind the in-memory service (in that order). This means the CICS App is never left without a working implementation and therefore avoiding loss of service.
32
32
33
33
We have chosen to separate each component of the application into distinct CICS bundles to give ultimate flexibility.
34
34
35
+
## Prerequisites
36
+
* CICS TS for z/OS 5.1 or above
37
+
* Java SE 7.1 or above
38
+
35
39
## Supporting Files
36
-
*[com.ibm.cicsdev.osgi.ds.cicsapp_1.0.0](projects/com.ibm.cicsdev.osgi.ds.cicsapp_1.0.0) - CICS application entry point
37
-
*[com.ibm.cicsdev.osgi.ds.cicsapp.bundle_1.0.0](projects/com.ibm.cicsdev.osgi.ds.cicsapp.bundle_1.0.0) - CICS Bundle containing the application, program and transaction definitions.
38
-
*[com.ibm.cicsdev.osgi.ds.storage_1.0.0](projects/com.ibm.cicsdev.osgi.ds.storage_1.0.0) - Interfaces for the storage service
39
-
*[com.ibm.cicsdev.osgi.ds.storage.bundle_1.0.0](projects/com.ibm.cicsdev.osgi.ds.storage.bundle_1.0.0) - CICS Bundle for the storage service interface
40
-
*[com.ibm.cicsdev.osgi.ds.storage.impl_1.0.0](projects/com.ibm.cicsdev.osgi.ds.storage.impl_1.0.0) - In-memory implementation of the storage service
41
-
*[com.ibm.cicsdev.osgi.ds.storage.impl.bundle_1.0.0](projects/com.ibm.cicsdev.osgi.ds.storage.impl.bundle_1.0.0) - CICS Bundle for the base in-memory implementation
42
-
*[com.ibm.cicsdev.osgi.ds.storage.impl_1.1.0](projects/com.ibm.cicsdev.osgi.ds.storage.impl_1.1.0) - TSQ implementation of the storage service
43
-
*[com.ibm.cicsdev.osgi.ds.storage.impl.bundle_1.1.0](projects/com.ibm.cicsdev.osgi.ds.storage.impl.bundle_1.1.0) - CICS Bundle for the TSQ implementation
40
+
*[com.ibm.cicsdev.osgi.ds.cicsapp_1.0.0](projects/com.ibm.cicsdev.osgi.ds.cicsapp_1.0.0) - OSGi bundle project containing the CICS application entry point
41
+
*[com.ibm.cicsdev.osgi.ds.cicsapp.bundle_1.0.0](projects/com.ibm.cicsdev.osgi.ds.cicsapp.bundle_1.0.0) - CICS bundle containing the application, program and transaction definitions.
42
+
*[com.ibm.cicsdev.osgi.ds.storage_1.0.0](projects/com.ibm.cicsdev.osgi.ds.storage_1.0.0) - OSGi bundle project containing interfaces for the storage service
43
+
*[com.ibm.cicsdev.osgi.ds.storage.bundle_1.0.0](projects/com.ibm.cicsdev.osgi.ds.storage.bundle_1.0.0) - CICS bundle for the storage service interface
44
+
*[com.ibm.cicsdev.osgi.ds.storage.impl_1.0.0](projects/com.ibm.cicsdev.osgi.ds.storage.impl_1.0.0) - OSGi bundle project containing the in-memory implementation of the storage service
45
+
*[com.ibm.cicsdev.osgi.ds.storage.impl.bundle_1.0.0](projects/com.ibm.cicsdev.osgi.ds.storage.impl.bundle_1.0.0) - CICS bundle for the base in-memory implementation
46
+
*[com.ibm.cicsdev.osgi.ds.storage.impl_1.1.0](projects/com.ibm.cicsdev.osgi.ds.storage.impl_1.1.0) - OSGi bundle project containing the TSQ implementation of the storage service
47
+
*[com.ibm.cicsdev.osgi.ds.storage.impl.bundle_1.1.0](projects/com.ibm.cicsdev.osgi.ds.storage.impl.bundle_1.1.0) - CICS bundle for the TSQ implementation
44
48
45
49
## Usage
46
-
1. Deploy all the CICS bundle projects to z/FS
47
-
2. Create an OSGi JVM server with the name `DFHOSGI`.
48
-
3. Create CICS bundle definitions for these bundle projects. [Table 1](#table-1) shows the mapping of bundle to bundle name used.
49
-
4. Install the bundle definitions: `DS `, `DS-APP ` and `DS-IMP10`.
50
-
5. Run the transaction `DSTS PUT INMEM`, this should display the message `Created entry 1`
51
-
6. Run the transaction `DSTS GET 1`, this should display the message `INMEM`, which confirms the data was stored correctly in-memory
52
-
7. Install the bundle `DS-IMP11`.
53
-
8. Disable the bundle `DS-IMP10`.
54
-
9. Run the transaction `DSTS GET 1`, this should ABEND because the entry was not found in the TSQ.
55
-
10. Run the transaction `DSTS PUT TSQ`, this should display the message `Created entry 1`
56
-
10. Run the transaction `DSTS GET 1`, this should display the message `TSQ`, which confirms the data was stored correctly in the TSQ (confirm by browsing on the TSQ `TSQS`, using the `CEBR` transaction for example).
57
-
11. The standard out (STDOUT) file for the JVM server should display messages that indicate the in-memory service (version 1.0.0) was first bound. Then later the service will be unbound when the bundle is disabled. You should also see that the TSQ service (1.1.0) is bound in it's place.
50
+
1. Clone or download this repository onto a local workstation
51
+
2. Import the projects into CICS Explorer
52
+
3. Deploy all the CICS bundle projects to zFS
53
+
4. Create an OSGi JVM server with the name `DFHOSGI`.
54
+
5. Create CICS bundle definitions for these OSGi bundle projects. [Table 1](#table-1) shows the mapping of bundle to bundle name used.
55
+
6. Install the CICS bundle definitions: `DS `, `DS-APP ` and `DS-IMP10`.
56
+
7. Run the transaction `DSTS PUT INMEM`, this should display the message `Created entry 1`
57
+
8. Run the transaction `DSTS GET 1`, this should display the message `INMEM`, which confirms the data was stored correctly in-memory
58
+
9. Install the CICS bundle `DS-IMP11`.
59
+
10. Disable the CICS bundle `DS-IMP10`.
60
+
11. Run the transaction `DSTS GET 1`, this should abend because the entry was not found in the TSQ.
61
+
12. Run the transaction `DSTS PUT TSQ`, this should display the message `Created entry 1`
62
+
13. Run the transaction `DSTS GET 1`, this should display the message `TSQ`, which confirms the data was stored correctly in the TSQ (confirm by browsing on the TSQ `TSQS`, using the `CEBR` transaction for example).
63
+
14. The standard out (STDOUT) file for the JVM server should display messages that indicate the in-memory service (version 1.0.0) was first bound. Then later the service will be unbound when the OSGi bundle is disabled. You should also see that the TSQ service (1.1.0) is bound in it's place.
0 commit comments