Update of
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/resources
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22569/xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/resources
Modified Files:
lookup.xdt
Log Message:
Back-out of last commit. This needs some more thinking.
Index: lookup.xdt
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/resources/lookup.xdt,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** lookup.xdt 28 May 2005 11:05:24 -0000 1.15
--- lookup.xdt 4 Jun 2005 19:12:56 -0000 1.16
***************
*** 23,29 ****
<XDtEjbMdb:ifMessageDriven>
/** <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_cached_queue"/> */
! private static <XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/> cachedQueue = null;
/** <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_cached_connection_factory"/> */
! private static <XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/>ConnectionFactory cachedConnectionFactory = null;
</XDtEjbMdb:ifMessageDriven>
</XDtConfig:ifConfigParamEquals>
--- 23,29 ----
<XDtEjbMdb:ifMessageDriven>
/** <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_cached_queue"/> */
! private static javax.jms.Queue cachedQueue = null;
/** <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_cached_connection_factory"/> */
! private static javax.jms.QueueConnectionFactory cachedConnectionFactory =
null;
</XDtEjbMdb:ifMessageDriven>
</XDtConfig:ifConfigParamEquals>
***************
*** 37,45 ****
* @return <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="queue_for"
arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static <XDtConfig:ifConfigParamEquals paramName="cacheHomes"
value="true">synchronized</XDtConfig:ifConfigParamEquals>
<XDtClass:classTagValue tagName="ejb:bean" paramName="destination-type"/>
getQueue() throws javax.naming.NamingException
{
<XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
if (cachedQueue == null) {
! cachedQueue = getQueue(null);
}
return cachedQueue;
--- 37,52 ----
* @return <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="queue_for"
arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static javax.jms.Queue getQueue() throws
javax.naming.NamingException
{
<XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
if (cachedQueue == null) {
! // <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
! javax.naming.InitialContext initialContext = new
javax.naming.InitialContext();
! try {
! java.lang.Object objRef =
initialContext.lookup(DESTINATION_JNDI_NAME);
! cachedQueue = (javax.jms.Queue) objRef;
! } finally {
! initialContext.close();
! }
}
return cachedQueue;
***************
*** 47,51 ****
<XDtConfig:ifConfigParamNotEquals paramName="cacheHomes" value="true">
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
! return getQueue(null);
</XDtConfig:ifConfigParamNotEquals>
}
--- 54,64 ----
<XDtConfig:ifConfigParamNotEquals paramName="cacheHomes" value="true">
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
! javax.naming.InitialContext initialContext = new
javax.naming.InitialContext();
! try {
! java.lang.Object objRef =
initialContext.lookup(DESTINATION_JNDI_NAME);
! return (javax.jms.Queue) objRef;
! } finally {
! initialContext.close();
! }
</XDtConfig:ifConfigParamNotEquals>
}
***************
*** 56,66 ****
* @return <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="queue_for"
arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static <XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/> getQueue( final java.util.Hashtable environment
) throws javax.naming.NamingException
{
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
javax.naming.InitialContext initialContext = new
javax.naming.InitialContext(environment);
try {
! final java.lang.Object objRef =
initialContext.lookup(DESTINATION_JNDI_NAME);
! return (<XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/>) objRef;
} finally {
initialContext.close();
--- 69,79 ----
* @return <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages" resource="queue_for"
arguments="<XDtEjb:ejbName/>"/> <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static javax.jms.Queue getQueue( java.util.Hashtable environment )
throws javax.naming.NamingException
{
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
javax.naming.InitialContext initialContext = new
javax.naming.InitialContext(environment);
try {
! java.lang.Object objRef =
initialContext.lookup(DESTINATION_JNDI_NAME);
! return (javax.jms.Queue) objRef;
} finally {
initialContext.close();
***************
*** 72,94 ****
* @return <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="connection_factory_for" arguments="<XDtEjb:ejbName/>"/>
<XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static <XDtConfig:ifConfigParamEquals paramName="cacheHomes"
value="true">synchronized</XDtConfig:ifConfigParamEquals>
<XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/>Connection getQueueConnection() throws
javax.naming.NamingException, javax.jms.JMSException
{
<XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
if (cachedConnectionFactory == null) {
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
! final javax.naming.InitialContext initialContext = new
javax.naming.InitialContext();
try {
! final java.lang.Object objRef =
initialContext.lookup(CONNECTION_FACTORY_JNDI_NAME);
! cachedConnectionFactory = (<XDtClass:classTagValue
tagName="ejb:bean" paramName="destination-type"/>ConnectionFactory) objRef;
} finally {
initialContext.close();
}
}
!
! final <XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/>Connection connection = (<XDtClass:classTagValue
tagName="ejb:bean" paramName="destination-type"/>Connection)
cachedConnectionFactory.createConnection();
! return connection;
</XDtConfig:ifConfigParamEquals>
<XDtConfig:ifConfigParamNotEquals paramName="cacheHomes" value="true">
! return getQueueConnection(null);
</XDtConfig:ifConfigParamNotEquals>
}
--- 85,112 ----
* @return <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="connection_factory_for" arguments="<XDtEjb:ejbName/>"/>
<XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static javax.jms.QueueConnection getQueueConnection() throws
javax.naming.NamingException, javax.jms.JMSException
{
<XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
if (cachedConnectionFactory == null) {
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
! javax.naming.InitialContext initialContext = new
javax.naming.InitialContext();
try {
! java.lang.Object objRef =
initialContext.lookup(CONNECTION_FACTORY_JNDI_NAME);
! cachedConnectionFactory = (javax.jms.QueueConnectionFactory)
objRef;
} finally {
initialContext.close();
}
}
! return cachedConnectionFactory.createQueueConnection();
</XDtConfig:ifConfigParamEquals>
<XDtConfig:ifConfigParamNotEquals paramName="cacheHomes" value="true">
! // <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
! javax.naming.InitialContext initialContext = new
javax.naming.InitialContext();
! try {
! java.lang.Object objRef =
initialContext.lookup(CONNECTION_FACTORY_JNDI_NAME);
! return ((javax.jms.QueueConnectionFactory)
objRef).createQueueConnection();
! } finally {
! initialContext.close();
! }
</XDtConfig:ifConfigParamNotEquals>
}
***************
*** 99,111 ****
* @return <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="connection_factory_for" arguments="<XDtEjb:ejbName/>"/>
<XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static <XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/>Connection getQueueConnection( final
java.util.Hashtable environment ) throws javax.naming.NamingException,
javax.jms.JMSException
{
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
! final javax.naming.InitialContext initialContext = new
javax.naming.InitialContext(environment);
try {
! final java.lang.Object objRef =
initialContext.lookup(CONNECTION_FACTORY_JNDI_NAME);
! final <XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/>ConnectionFactory factory =
(<XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/>ConnectionFactory) objRef;
! final <XDtClass:classTagValue tagName="ejb:bean"
paramName="destination-type"/>Connection connection = (<XDtClass:classTagValue
tagName="ejb:bean" paramName="destination-type"/>Connection)
factory.createConnection();
! return connection;
} finally {
initialContext.close();
--- 117,127 ----
* @return <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="connection_factory_for" arguments="<XDtEjb:ejbName/>"/>
<XDtI18n:getString bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_lookup_using" arguments="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static javax.jms.QueueConnection getQueueConnection(
java.util.Hashtable environment ) throws javax.naming.NamingException,
javax.jms.JMSException
{
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_obtain_ic"/>
! javax.naming.InitialContext initialContext = new
javax.naming.InitialContext(environment);
try {
! java.lang.Object objRef =
initialContext.lookup(CONNECTION_FACTORY_JNDI_NAME);
! return ((javax.jms.QueueConnectionFactory)
objRef).createQueueConnection();
} finally {
initialContext.close();
***************
*** 115,123 ****
<XDtEjbMdb:ifNotMessageDriven>
! private static Object lookupHome( final java.util.Hashtable environment,
final String jndiName, final Class narrowTo) throws
javax.naming.NamingException {
// Obtain initial context
! final javax.naming.InitialContext initialContext = new
javax.naming.InitialContext(environment);
try {
! final Object objRef = initialContext.lookup(jndiName);
// only narrow if necessary
if (java.rmi.Remote.class.isAssignableFrom(narrowTo))
--- 131,139 ----
<XDtEjbMdb:ifNotMessageDriven>
! private static Object lookupHome(java.util.Hashtable environment, String
jndiName, Class narrowTo) throws javax.naming.NamingException {
// Obtain initial context
! javax.naming.InitialContext initialContext = new
javax.naming.InitialContext(environment);
try {
! Object objRef = initialContext.lookup(jndiName);
// only narrow if necessary
if (java.rmi.Remote.class.isAssignableFrom(narrowTo))
***************
*** 137,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="<XDtEjbUtilObj:lookupKind/>"/>
*/
! public static <XDtConfig:ifConfigParamEquals paramName="cacheHomes"
value="true">synchronized</XDtConfig:ifConfigParamEquals>
<XDtEjbHome:homeInterface type="remote"/> getHome() throws
javax.naming.NamingException
{
<XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
--- 153,157 ----
* @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/>"/>
*/
! public static <XDtEjbHome:homeInterface type="remote"/> getHome() throws
javax.naming.NamingException
{
<XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
***************
*** 155,159 ****
* @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/>"/>
*/
! public static <XDtEjbHome:homeInterface type="remote"/> getHome( final
java.util.Hashtable environment ) throws javax.naming.NamingException
{
return (<XDtEjbHome:homeInterface type="remote"/>)
lookupHome(environment, <XDtEjbHome:homeInterface
type="remote"/>.<XDtEjbUtilObj:lookupKind/>, <XDtEjbHome:homeInterface
type="remote"/>.class);
--- 171,175 ----
* @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/>"/>
*/
! public static <XDtEjbHome:homeInterface type="remote"/> getHome(
java.util.Hashtable environment ) throws javax.naming.NamingException
{
return (<XDtEjbHome:homeInterface type="remote"/>)
lookupHome(environment, <XDtEjbHome:homeInterface
type="remote"/>.<XDtEjbUtilObj:lookupKind/>, <XDtEjbHome:homeInterface
type="remote"/>.class);
***************
*** 166,170 ****
* @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/>"/>
*/
! public static <XDtConfig:ifConfigParamEquals paramName="cacheHomes"
value="true">synchronized</XDtConfig:ifConfigParamEquals>
<XDtEjbHome:homeInterface type="local"/> getLocalHome() throws
javax.naming.NamingException
{
<XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
--- 182,186 ----
* @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/>"/>
*/
! public static <XDtEjbHome:homeInterface type="local"/> getLocalHome()
throws javax.naming.NamingException
{
<XDtConfig:ifConfigParamEquals paramName="cacheHomes" value="true">
***************
*** 198,206 ****
* <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_guid_usage"/>
*/
! public static synchronized final String generateGUID(final Object o) {
! final StringBuffer tmpBuffer = new StringBuffer(16);
if (hexServerIP == null) {
! final java.net.InetAddress localInetAddress;
try {
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_guid_localinetaddress"/>
--- 214,222 ----
* <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_guid_usage"/>
*/
! public static final String generateGUID(Object o) {
! StringBuffer tmpBuffer = new StringBuffer(16);
if (hexServerIP == null) {
! java.net.InetAddress localInetAddress = null;
try {
// <XDtI18n:getString
bundle="xdoclet.modules.ejb.XDocletModulesEjbMessages"
resource="util_guid_localinetaddress"/>
***************
*** 214,230 ****
return null;
}
! final byte serverIP[] = localInetAddress.getAddress();
hexServerIP = hexFormat(getInt(serverIP), 8);
}
! final String hashcode = hexFormat(System.identityHashCode(o), 8);
tmpBuffer.append(hexServerIP);
tmpBuffer.append(hashcode);
! final long timeNow = System.currentTimeMillis();
! final int timeLow = (int)timeNow & 0xFFFFFFFF;
! final int node = seeder.nextInt();
! final StringBuffer guid = new StringBuffer(32);
guid.append(hexFormat(timeLow, 8));
guid.append(tmpBuffer.toString());
--- 230,246 ----
return null;
}
! byte serverIP[] = localInetAddress.getAddress();
hexServerIP = hexFormat(getInt(serverIP), 8);
}
! String hashcode = hexFormat(System.identityHashCode(o), 8);
tmpBuffer.append(hexServerIP);
tmpBuffer.append(hashcode);
! long timeNow = System.currentTimeMillis();
! int timeLow = (int)timeNow & 0xFFFFFFFF;
! int node = seeder.nextInt();
! StringBuffer guid = new StringBuffer(32);
guid.append(hexFormat(timeLow, 8));
guid.append(tmpBuffer.toString());
***************
*** 237,241 ****
int j = 24;
for (int k = 0; j >= 0; k++) {
! final int l = bytes[k] & 0xff;
i += l << j;
j -= 8;
--- 253,257 ----
int j = 24;
for (int k = 0; j >= 0; k++) {
! int l = bytes[k] & 0xff;
i += l << j;
j -= 8;
***************
*** 244,254 ****
}
! private static String hexFormat(final int i, final int j) {
! final String s = Integer.toHexString(i);
return padHex(s, j) + s;
}
! private static String padHex(final String s, final int i) {
! final StringBuffer tmpBuffer = new StringBuffer();
if (s.length() < i) {
for (int j = 0; j < i - s.length(); j++) {
--- 260,270 ----
}
! private static String hexFormat(int i, int j) {
! String s = Integer.toHexString(i);
return padHex(s, j) + s;
}
! private static String padHex(String s, int i) {
! StringBuffer tmpBuffer = new StringBuffer();
if (s.length() < i) {
for (int j = 0; j < i - s.length(); j++) {
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
xdoclet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel