Subversion Repositories DevTools

Rev

Rev 1815 | Rev 4341 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1815 Rev 4148
Line 6... Line 6...
6
<XDtEjbIntf:ifRemoteEjb>
6
<XDtEjbIntf:ifRemoteEjb>
7
import javax.rmi.PortableRemoteObject;
7
import javax.rmi.PortableRemoteObject;
8
</XDtEjbIntf:ifRemoteEjb>
8
</XDtEjbIntf:ifRemoteEjb>
9
import javax.naming.NamingException;
9
import javax.naming.NamingException;
10
import javax.naming.InitialContext;
10
import javax.naming.InitialContext;
-
 
11
import java.util.Hashtable;
-
 
12
import javax.naming.Context;
11
<XDtEjbIntf:ifRemoteEjb>
13
<XDtEjbIntf:ifRemoteEjb>
12
import java.util.Date;
14
import java.util.Date;
13
import java.util.Hashtable;
-
 
14
import java.util.Properties;
15
import java.util.Properties;
15
</XDtEjbIntf:ifRemoteEjb>
16
</XDtEjbIntf:ifRemoteEjb>
16
 
17
 
17
<XDtConfig:ifConfigParamEquals paramName="includeGUID" value="true">
18
<XDtConfig:ifConfigParamEquals paramName="includeGUID" value="true">
18
import java.net.InetAddress;
19
import java.net.InetAddress;
Line 55... Line 56...
55
   // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_home_lookups"/>
56
   // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_home_lookups"/>
56
 
57
 
57
   <XDtEjbIntf:ifRemoteEjb>
58
   <XDtEjbIntf:ifRemoteEjb>
58
   /**
59
   /**
59
    * <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_home_def_ic"/>
60
    * <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_home_def_ic"/>
60
    * @return <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="home_interface_for" arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
61
    * @return <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="home_interface_for" arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_lookup_using" arguments="JNDI_NAME"/>
61
    */
62
    */
62
   public static <XDtEjbHome:homeInterface type="remote"/> getHome() throws NamingException
63
   public static <XDtEjbHome:homeInterface type="remote"/> getHome() throws NamingException
63
   {
64
   {
64
      <XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
65
      <XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
65
      if ( cachedRemoteHome != null )
66
      if ( cachedRemoteHome != null )
Line 102... Line 103...
102
      {
103
      {
103
      </XDtClass:ifHasClassTag>
104
      </XDtClass:ifHasClassTag>
104
   
105
   
105
      <XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
106
      <XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
106
         // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
107
         // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
-
 
108
		 Hashtable properties = new Hashtable();
-
 
109
		 properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
107
         InitialContext initialContext = new InitialContext();
110
         InitialContext initialContext = new InitialContext(properties);
108
         try {
111
         try {
109
            java.lang.Object objRef = initialContext.lookup(<XDtEjbHome:homeInterface type="remote"/>.<XDtEjbUtilObj:lookupKind/>);
112
            java.lang.Object objRef = initialContext.lookup(<XDtEjbHome:homeInterface type="remote"/>.JNDI_NAME);
110
            cachedRemoteHome = (<XDtEjbHome:homeInterface type="remote"/>) PortableRemoteObject.narrow(objRef, <XDtEjbHome:homeInterface type="remote"/>.class);
113
            cachedRemoteHome = (<XDtEjbHome:homeInterface type="remote"/>) PortableRemoteObject.narrow(objRef, <XDtEjbHome:homeInterface type="remote"/>.class);
111
         } finally {
114
         } finally {
112
            initialContext.close();
115
            initialContext.close();
113
         }
116
         }
114
 
117
 
Line 118... Line 121...
118
 
121
 
119
      return cachedRemoteHome;
122
      return cachedRemoteHome;
120
      </XDtConfig:ifConfigParamEquals>
123
      </XDtConfig:ifConfigParamEquals>
121
      <XDtConfig:ifConfigParamNotEquals paramName="cacheHomes" value="true">
124
      <XDtConfig:ifConfigParamNotEquals paramName="cacheHomes" value="true">
122
      // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
125
      // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
-
 
126
	  Hashtable properties = new Hashtable();
-
 
127
	  properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
123
      InitialContext initialContext = new InitialContext();
128
	  InitialContext initialContext = new InitialContext(properties);
124
      try {
129
      try {
125
         java.lang.Object objRef = initialContext.lookup(<XDtEjbHome:homeInterface type="remote"/>.<XDtEjbUtilObj:lookupKind/>);
130
         java.lang.Object objRef = initialContext.lookup(<XDtEjbHome:homeInterface type="remote"/>.JNDI_NAME);
126
         return (<XDtEjbHome:homeInterface type="remote"/>) PortableRemoteObject.narrow(objRef, <XDtEjbHome:homeInterface type="remote"/>.class);
131
         return (<XDtEjbHome:homeInterface type="remote"/>) PortableRemoteObject.narrow(objRef, <XDtEjbHome:homeInterface type="remote"/>.class);
127
      } finally {
132
      } finally {
128
         initialContext.close();
133
         initialContext.close();
129
      }
134
      }
130
      </XDtConfig:ifConfigParamNotEquals>
135
      </XDtConfig:ifConfigParamNotEquals>
131
   }
136
   }
132
 
137
 
133
   /**
138
   /**
134
    * <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_home_param_ic"/>
139
    * <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_home_param_ic"/>
135
    * @param environment <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_ic_parameters"/>
140
    * @param environment <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_ic_parameters"/>
136
    * @return <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="home_interface_for" arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
141
    * @return <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="home_interface_for" arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_lookup_using" arguments="JNDI_NAME"/>
137
    */
142
    */
138
   public static <XDtEjbHome:homeInterface type="remote"/> getHome( Hashtable environment ) throws NamingException
143
   public static <XDtEjbHome:homeInterface type="remote"/> getHome( Hashtable environment ) throws NamingException
139
   {
144
   {
140
      // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
145
      // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
141
      Date now = new Date();
146
      Date now = new Date();
Line 185... Line 190...
185
   </XDtEjbIntf:ifRemoteEjb>
190
   </XDtEjbIntf:ifRemoteEjb>
186
 
191
 
187
   <XDtEjbIntf:ifLocalEjb>
192
   <XDtEjbIntf:ifLocalEjb>
188
   /**
193
   /**
189
    * <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_localhome_def_ic"/>
194
    * <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_localhome_def_ic"/>
190
    * @return <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="local_home_interface_for" arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
195
    * @return <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="local_home_interface_for" arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_lookup_using" arguments="COMP_NAME"/>
191
    */
196
    */
192
   public static <XDtEjbHome:homeInterface type="local"/> getLocalHome() throws NamingException
197
   public static <XDtEjbHome:homeInterface type="local"/> getLocalHome() throws NamingException
193
   {
198
   {
194
      // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_localhome_not_narrowed"/>
199
      // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_localhome_not_narrowed"/>
195
      <XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
200
      <XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
196
      if (cachedLocalHome == null) {
201
      if (cachedLocalHome == null) {
197
         // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
202
         // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
-
 
203
         Hashtable properties = new Hashtable();
-
 
204
		 properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
198
         InitialContext initialContext = new InitialContext();
205
         InitialContext initialContext = new InitialContext(properties);
199
         try {
206
         try {
200
            cachedLocalHome = (<XDtEjbHome:homeInterface type="local"/>) initialContext.lookup(<XDtEjbHome:homeInterface type="local"/>.<XDtEjbUtilObj:lookupKind/>);
207
            cachedLocalHome = (<XDtEjbHome:homeInterface type="local"/>) initialContext.lookup(<XDtEjbHome:homeInterface type="local"/>.COMP_NAME);
201
         } finally {
208
         } finally {
202
            initialContext.close();
209
            initialContext.close();
203
         }
210
         }
204
      }
211
      }
205
      return cachedLocalHome;
212
      return cachedLocalHome;
206
      </XDtConfig:ifConfigParamEquals>
213
      </XDtConfig:ifConfigParamEquals>
207
      <XDtConfig:ifConfigParamNotEquals paramName="cacheHomes" value="true">
214
      <XDtConfig:ifConfigParamNotEquals paramName="cacheHomes" value="true">
208
      // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
215
      // <XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="util_obtain_ic"/>
-
 
216
      Hashtable properties = new Hashtable();
-
 
217
	  properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
209
      InitialContext initialContext = new InitialContext();
218
	  InitialContext initialContext = new InitialContext(properties);
210
      try {
219
      try {
211
         return (<XDtEjbHome:homeInterface type="local"/>) initialContext.lookup(<XDtEjbHome:homeInterface type="local"/>.<XDtEjbUtilObj:lookupKind/>);
220
         return (<XDtEjbHome:homeInterface type="local"/>) initialContext.lookup(<XDtEjbHome:homeInterface type="local"/>.COMP_NAME);
212
      } finally {
221
      } finally {
213
         initialContext.close();
222
         initialContext.close();
214
      }
223
      }
215
      </XDtConfig:ifConfigParamNotEquals>
224
      </XDtConfig:ifConfigParamNotEquals>
216
   }
225
   }
Line 314... Line 323...
314
      public void run()
323
      public void run()
315
      {
324
      {
316
         InitialContext initialContext = null;
325
         InitialContext initialContext = null;
317
         try
326
         try
318
         {
327
         {
-
 
328
			this.environment.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");         
319
            initialContext = new InitialContext(environment);
329
            initialContext = new InitialContext(environment);
320
            java.lang.Object objRef = initialContext.lookup(<XDtEjbHome:homeInterface type="remote"/>.<XDtEjbUtilObj:lookupKind/>);
330
            java.lang.Object objRef = initialContext.lookup(<XDtEjbHome:homeInterface type="remote"/>.JNDI_NAME);
321
            home = (<XDtEjbHome:homeInterface type="remote"/>) PortableRemoteObject.narrow(objRef, <XDtEjbHome:homeInterface type="remote"/>.class);
331
            home = (<XDtEjbHome:homeInterface type="remote"/>) PortableRemoteObject.narrow(objRef, <XDtEjbHome:homeInterface type="remote"/>.class);
322
         
332
         
323
            synchronized( this )
333
            synchronized( this )
324
            {
334
            {
325
               this.notify();
335
               this.notify();