1 22 package org.jboss.tutorial.dependency.client; 23 24 import javax.naming.InitialContext ; 25 26 import org.jboss.tutorial.dependency.bean.HasXmlMBeanDependency; 27 28 34 public class Client 35 { 36 public static void main(String [] args) throws Exception 37 { 38 InitialContext jndiContext = new InitialContext (); 39 40 try 41 { 42 HasXmlMBeanDependency dependency = (HasXmlMBeanDependency)jndiContext.lookup("HasXmlMBeanDependencyBean/remote"); 43 dependency.noop(); 44 System.out.println("Lookup and bean access succeeded"); 45 } 46 catch (Exception e) 47 { 48 System.out.println("Caught unsatisfied dependency exception " + e); 49 } 50 } 51 } 52 | Popular Tags |