Package javax.management.j2ee

Examples of javax.management.j2ee.Management


    * @throws Exception
    */
   public void testJNDIResource() throws Exception
   {
      getLog().debug("+++ testJNDIResource");
      Management jsr77MEJB = getManagementEJB();
      String domainName = jsr77MEJB.getDefaultDomain();
      ObjectName queryName = new ObjectName(domainName + ":" + J2EEManagedObject.TYPE + "=" + J2EETypeConstants.JNDIResource + "," + "*");
      // TODO - this used to work, Scott's new naming required?
/*
      Set names = jsr77MEJB.queryNames(queryName, null);
      if (names.isEmpty())
      {
         fail("Could not find JSR-77 JNDIResource '" + J2EETypeConstants.JNDIResource + "'");
      }
      Iterator iter = names.iterator();
      while (iter.hasNext())
         getLog().debug("JNDIResource: " + iter.next());
*/
      jsr77MEJB.remove();
   }
View Full Code Here


    * @throws Exception
    */
   public void testJavaMailResource() throws Exception
   {
      getLog().debug("+++ testJavaMailResource");
      Management jsr77MEJB = getManagementEJB();
      String domainName = jsr77MEJB.getDefaultDomain();
      ObjectName queryName = new ObjectName(domainName + ":" +
         J2EEManagedObject.TYPE + "=" + J2EETypeConstants.JavaMailResource + "," + "*");
      Set names = jsr77MEJB.queryNames(queryName, null);
      if (names.isEmpty())
      {
         fail("Could not find JSR-77 JavaMailResource '" + J2EETypeConstants.JavaMailResource + "'");
      }
      Iterator iter = names.iterator();
      while (iter.hasNext())
         getLog().debug("JavaMailResource: " + iter.next());
      jsr77MEJB.remove();
   }
View Full Code Here

    * @throws Exception
    */
   public void testJTAResource() throws Exception
   {
      getLog().debug("+++ testJTAResource");
      Management jsr77MEJB = getManagementEJB();
      String domainName = jsr77MEJB.getDefaultDomain();
      ObjectName queryName = new ObjectName(domainName + ":" +
         J2EEManagedObject.TYPE + "=" + J2EETypeConstants.JTAResource + "," + "*");
      Set names = jsr77MEJB.queryNames(queryName, null);
      if (names.isEmpty())
      {
         fail("Could not find JSR-77 JTAResource '" + J2EETypeConstants.JTAResource + "'");
      }
      Iterator iter = names.iterator();
      while (iter.hasNext())
         getLog().debug("JTAResource: " + iter.next());
      jsr77MEJB.remove();
   }
View Full Code Here

    public void testLogin() throws Exception {  
        Hashtable env = getEnvironment();
        env.put(Context.SECURITY_PRINCIPAL, "system");
        env.put(Context.SECURITY_CREDENTIALS, "manager");
       
        Management mgmt = getMEJB(env);
        System.out.println(mgmt.getDefaultDomain());
        assertEquals("geronimo", mgmt.getDefaultDomain());       
    }
View Full Code Here

        if (password != null) {
            env.put(Context.SECURITY_CREDENTIALS, password);
        }
       
        try {
            Management mgmt = getMEJB(env);
            fail("Did not throw security exception");
        } catch (AuthenticationException e) {
            // expected
            e.printStackTrace(System.out);
        } catch (AccessException e) {
View Full Code Here

        String jndiName = "ejb/mgmt/MEJB";
        InitialContext ctx = new InitialContext(env);
        Object objref = ctx.lookup(jndiName);
        ManagementHome home = (ManagementHome)
            PortableRemoteObject.narrow(objref,ManagementHome.class);
        Management mejb = home.create();
        return mejb;
    }
View Full Code Here

    public void testLogin() throws Exception {  
        Hashtable env = getEnvironment();
        env.put(Context.SECURITY_PRINCIPAL, "system");
        env.put(Context.SECURITY_CREDENTIALS, "manager");
       
        Management mgmt = getMEJB(env);
        System.out.println(mgmt.getDefaultDomain());
        assertEquals("geronimo", mgmt.getDefaultDomain());       
    }
View Full Code Here

        if (password != null) {
            env.put(Context.SECURITY_CREDENTIALS, password);
        }
       
        try {
            Management mgmt = getMEJB(env);
            fail("Did not throw security exception");
        } catch (AuthenticationException e) {
            // expected
            e.printStackTrace(System.out);
        } catch (AccessException e) {
View Full Code Here

        String jndiName = "ejb/mgmt/MEJBRemoteHome"; // should be "ejb/mgmt/MEJB"
        InitialContext ctx = new InitialContext(env);
        Object objref = ctx.lookup(jndiName);
        ManagementHome home = (ManagementHome)
            PortableRemoteObject.narrow(objref,ManagementHome.class);
        Management mejb = home.create();
        return mejb;
    }
View Full Code Here

    * @throws Exception
    */
   public void testConnect() throws Exception
   {
      log.debug("+++ testConnect");
      Management jsr77MEJB = getManagementEJB();
      String lDomain = jsr77MEJB.getDefaultDomain();
      log.debug("+++ testConnect, domain: " + lDomain);
      jsr77MEJB.remove();
   }
View Full Code Here

TOP

Related Classes of javax.management.j2ee.Management

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.