hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jake Shapiro" <>
Subject How to pass runtime jndiName param to EJBProxyFactory in hivemind 1.1.1
Date Thu, 08 Feb 2007 07:14:15 GMT


Note: This e-mail is subject to the disclaimer contained at the bottom of this message.

I'm using hivemind 1.1.1 to perform JNDI lookup of remote session EJB
whose providerUrl and jndiName are only known at runtime.

The providerUrl and jndiName are provided by the client with the
original request and during post-processing callback to the client is
made using these values to locate client remote service. While I managed
to pass providerUrl to NameLookup I'm unable to pass jndiName as neither
NameLookupImpl nor EJBProxyFactory have  setter for it. 

I have tried playing with configuration points and own implementation of
ServiceImplementationFactory without success. If I hard-code  jndi-name
attribute value it works but the problem is it's unknown at the
build/deployment time so it must be a run-time arg

Descriptor and code follows. 

<?xml version="1.0"?>
<module id="" version="1.1.1">
<!-- Client-side Service  -->
	<service-point id="ClientService"
interface="" />

	<implementation service-id="ClientService">
			<construct class="impl.ClientServiceImpl">
				<set-service property="remoteRef"
service-id="ClientServiceRemote" />
	<service-point id="ClientServiceRemote"
jndi-name="${jndiNameKey}" name-lookup-service-id="NameLookupService" />
		<interceptor service-id="hivemind.LoggingInterceptor" />

	<service-point id="NameLookupService"
		<invoke-factory service-id="hivemind.BuilderFactory"
				<set property="initialFactory"
value="" />
				<set property="providerURL"
value="${java.naming.provider.url}" />
		<interceptor service-id="hivemind.LoggingInterceptor" />

ClientService service  = getClientService(providerUrl, jndiName);
service.doSomething(); // barfs here
    protected final ClientService getClientService(final String
providerUrl,final String jndiName) {
        System.setProperty(Context.PROVIDER_URL, providerUrl);
        System.setProperty("jndiNameKey", jndiName);
        //  Construct Hivemind registry. 
        // By that time all system properties hivemind relies upon
should be set. 
        RegistryBuilder builder = new RegistryBuilder();
        Registry registry =
        return (ClientService )  registry.getService(

Any thoughts?



The information transmitted in this message and its attachments (if any) is intended 
only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in reliance 
upon this information, by persons or entities other than the intended recipient is 

If you have received this in error, please contact the sender and delete this e-mail 
and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or distribute 
the information contained in this e-mail and any attached files, with the permission 
of the sender.

This message has been scanned for viruses with Symantec Scan Engine and cleared by 

View raw message