|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| Logon using JNDI_Locator | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | mqwhelp | 
			  
				|  Posted: Thu May 16, 2002 8:00 am    Post subject: Logon using JNDI_Locator |   |  |  
		  | Voyager
 
 
 Joined: 20 Dec 2001Posts: 85
 Location: TCS
 
 | 
			  
				| Hi All, 
 I have read one example given in programming guide on JNDI_Locator policy.
 
 
 **********************
 
 public static void main ( String[] args )
 {
 ...
 Agent agent= new Agent();
 Properties prop = System.getProperties();
 prop.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY,
 "com.sun.jndi.cosnaming.CNCtx.Factory") ;
 prop.put( javax.naming.Context.PROVIDER_URL,
 "iiop://<Hostname of JNDI Name Server>:<JNDI Name Server Ports"" );
 agent.setContext( args, prop );
 agent.setLocator( Agent.JNDI_LOCATOR );
 agent.setName( "<AgentName>");
 ...
 }
 
 ******************************
 
 In this example I could not understand what I need to pass as "args"
 which is used in "agent.setContext(args,prop);"
 
 In my program ,I had set this value as
 
 String args[] = {"iiop://172.17.40.9:900/MQWFAGENT"};
 (IP address is the name of machine where MQ workflow server is running)
 
 and it worked successfully.
 
 My question is what I am doing above is correct .
 
 Please clarify the doubt about  agent.setContext(args,prop);
 
 Waiting for reply
 |  |  
		  | Back to top |  |  
		  |  |  
		  | manoj | 
			  
				|  Posted: Thu May 16, 2002 11:11 am    Post subject: |   |  |  
		  |  Master
 
 
 Joined: 30 Jan 2002Posts: 237
 Location: Virgina
 
 | 
			  
				| Hi, 
 u can define
 String args[] = {"<agent name>"};
 
 
 in u r case String args[] = {"MQWFAGENT"};
 
 cheers
 _________________
 -manoj
 |  |  
		  | Back to top |  |  
		  |  |  
		  | mqwhelp | 
			  
				|  Posted: Thu May 16, 2002 11:57 am    Post subject: using JNDI_locator |   |  |  
		  | Voyager
 
 
 Joined: 20 Dec 2001Posts: 85
 Location: TCS
 
 | 
			  
				| I am giving the name MQWFAGENT in the following command 
 agent.setName( "<AgentName>");
 
 My question is why I need to give String args[] = {"MQWFAGENT"};
 as I had mentioned the name using setName.
 
 Could you please let me know what does
 agent.setContext(args,prop);  mean ???
 
 Waiting for reply
 |  |  
		  | Back to top |  |  
		  |  |  
		  | manoj | 
			  
				|  Posted: Thu May 16, 2002 12:14 pm    Post subject: |   |  |  
		  |  Master
 
 
 Joined: 30 Jan 2002Posts: 237
 Location: Virgina
 
 | 
			  
				| Hi, It's saying that this is the agent which is published in the particular context. I think if u pass null for args still it should work because u r explicitly setting the name of the agent using setName() method.
 
 Are u able to established the connection ?
 _________________
 -manoj
 |  |  
		  | Back to top |  |  
		  |  |  
		  | mqwhelp | 
			  
				|  Posted: Thu May 16, 2002 1:25 pm    Post subject: |   |  |  
		  | Voyager
 
 
 Joined: 20 Dec 2001Posts: 85
 Location: TCS
 
 | 
			  
				| Thanxs for the reply 
 Yes , Its working for me though I am not using
 
 agent.setContext(args,prop);
 |  |  
		  | Back to top |  |  
		  |  |  
		  |  |  |  
  
	|    |  | Page 1 of 1 |  
 
 
  
  	| 
		
		  | 
 
 | You cannot post new topics in this forum You cannot reply to topics in this forum
 You cannot edit your posts in this forum
 You cannot delete your posts in this forum
 You cannot vote in polls in this forum
 
 |  |  |  |