blob: 057d6d8f7305fe8f898df668b2b3dd3b2dd16c4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
This test demonstrates the sharing of a single Ice object adapter for
multiple EJBs.
It setups 2 EJBs which both implement a similar service but with
slightly different Slice types: the Account class in the first version
has 1 string member and the second version has 2 string members:
// Version 1
class Account extends Base
{
string id;
};
// Version 2
class Account extends Base
{
string id;
string foo;
};
The Base class is defined in a Jar shared by both EJBs and install in
the lib directory of the application server.
Each EJB registers servants using the IceAdapter helper class. This
helper manages the shared Ice object adapter.
The helper registers the servant with the object adapter and uses a
dispatch interceptor to setup the thread context class loader to
ensure the servant invocations are un-marhsalled with the EJB class
loader.
With Ice 3.5, this interceptor will no longer be necessary, the Ice
core will provide a property to enable the setting of the thread
context class loader from the Ice core directly.
Building the test
-----------------
Set the JBOSS_HOME environment variable to your jboss-eap-5.1/jboss-as
directory, for example:
$ export JBOSS_HOME=$HOME/EnterprisePlatform-5.1.2/jboss-eap-5.1/jboss-as/
If Ice isn't installed in the default location set the ICE_HOME
environment variable to your Ice 3.7.0 installation directory.
Run ant to build and deploy the application:
$ ant deploy
This will deploy the following Jars to your JBoss server default
configuration:
$JBOSS_HOME/server/default/lib/Ice.jar
$JBOSS_HOME/server/default/lib/ice-ejb-test-common.jar
$JBOSS_HOME/server/default/deploy/ice-ejb-test-ejb1.jar
$JBOSS_HOME/server/default/deploy/ice-ejb-test-ejb2.jar
Run the clients
---------------
To run the client for the first EJB version:
$ ant run.client1
For the second EJB version:
$ ant run.client2
Note that the clients uses the Java naming provier specified in
src/resources/jndi.properties (jnp://127.0.0.1:1099) to obtain a
reference on the initialization EJB of each service. The Ice object
adapter listen on the port 10000 of the loopback interface.
|