Package com.sun.appserv.management.client

Examples of com.sun.appserv.management.client.ProxyFactory


        if ((null == clusterName) || "".equals(clusterName)) {
            throw new IllegalArgumentException();
        }
        ObjectName on = null;
        final MBeanServer mbs = getAdminMBeanServer();
        final ProxyFactory proxyFactory = ProxyFactory.getInstance(
            new MBeanServerConnectionSource(mbs));
        final Set proxies = proxyFactory.getDomainRoot().getQueryMgr().
            queryJ2EETypeSet(J2EECluster.J2EE_TYPE);
        final Iterator it = proxies.iterator();
        while (it.hasNext()) {
            J2EECluster cluster = (J2EECluster)it.next();
            if (cluster.getName().equals(clusterName)) {
View Full Code Here


      assert( container.getContainee( progenyJ2EEType, name== proxy  );
      final AMXConfig  progeny  = getProgeny( name );
      assert( progeny == proxy );

    // remove it
    final ProxyFactory  factory  = Util.getExtra( proxy ).getProxyFactory();
    assert( name.equals( progeny.getName() ) );
      remove( name );
      waitUnregistered( objectName );
      assert( ! getConnection().isRegistered( objectName ) );
      waitProxyGone( factory, objectName );
View Full Code Here

      final String[] attrNames   = Util.getExtra( amx ).getAttributeNames();
     
      AMXDebugStuff   result  = null;
      if ( GSetUtil.newUnmodifiableStringSet( attrNames ).contains( "AMXDebug" ) )
      {
          final ProxyFactory  factory = Util.getExtra( amx ).getProxyFactory();
             
            try
            {
              final Class     amxClass    =
                  ClassUtil.getClassFromName( Util.getExtra( amx ).getInterfaceName() );
              final Class[]   interfaces  = new Class[] { amxClass, AMXDebugStuff.class };
             
                final ObjectName    objectName  = Util.getObjectName( amx );
               
                return (AMXDebugStuff)
                    factory.newProxyInstance( objectName, interfaces );
            }
            catch( Exception e )
            {
                trace( ExceptionUtil.toString( e ) );
                throw new RuntimeException( e );
View Full Code Here

  getAllAMX()
  {
      final SortedSet<ObjectName>   all = getAllObjectNames();
     
      final SortedSet<AMX>    allAMX  = new TreeSet<AMX>( new AMXComparator<AMX>() );
      final ProxyFactory  proxyFactory    = Util.getExtra( mDomainRoot ).getProxyFactory();
      for( final ObjectName objectName : all )
      {
          try
          {
              final AMX   amx = proxyFactory.getProxy( objectName, AMX.class );
             
              allAMX.add( amx );
          }
          catch( Exception e )
          {
View Full Code Here

    final NotificationServiceMgr  mgr  = getDomainRoot().getNotificationServiceMgr();
    final NotificationService  ns  = mgr.createNotificationService( "UserData", 10 );
    final ObjectName  nsObjectName  = Util.getObjectName( ns );
    assert( ns.getUserData().equals( "UserData" ) );
   
    final ProxyFactory  factory  = getProxyFactory();
    final NotificationService  proxy  =
      factory.getProxy( nsObjectName, NotificationService.class, false );
    assert( proxy == ns ) : "proxies differ: " + ns + "\n" + proxy;
   
    mgr.removeNotificationService( ns.getName() );

    int  iterations  = 0;
    long  sleepMillis  = 10;
    while( factory.getProxy( nsObjectName, NotificationService.class, false ) != null )
    {
      mySleep( sleepMillis );
      if ( sleepMillis >= 400 )
      {
        trace( "testProxyFactoryDetectsMBeanRemoved: waiting for proxy to be removed" );
View Full Code Here


    protected final AMX
  getProxy( final ObjectName objectName )
  {
    final ProxyFactory  factory  = ProxyFactory.getInstance( getConnectionSource(), true);
   
    final AMX proxy   = factory.getProxy( objectName, AMX.class );
   
    return( proxy );
  }
View Full Code Here

  }

    public final DomainRoot
  getDomainRoot()
  {
    final ProxyFactory    factory    =
        ProxyFactory.getInstance( getMBeanServer() );
   
    return( factory.getDomainRoot() );
  }
View Full Code Here

      - Map of <j2eeType>=<Map of <name>=<ObjectName>
     */
    Map<String,?>  result  = null;
    if ( m.keySet().size() != 0 )
    {
        final ProxyFactory  proxyFactory    = getProxyFactory();
   
      final Object firstValue  = m.values().iterator().next();
     
      if ( firstValue instanceof ObjectName )
      {
        // it's <name>=<ObjectName>
        final Map<String,ObjectName>  onm = TypeCast.asMap( m );
        final Map<String,AMX> proxyMap  = proxyFactory.toProxyMap( onm );
        result  = proxyMap;
      }
      else if ( firstValue instanceof Map )
      {
        final Map<String,Map<String,ObjectName>> objectNameMaps = TypeCast.asMap( m );
        final Map<String,Map<String,AMX>> proxyMaps  = new HashMap<String,Map<String,AMX>>();
       
        for ( final String j2eeType : objectNameMaps.keySet() )
        {
          final Map<String,ObjectName> objectNameMap  = objectNameMaps.get( j2eeType );
          final Map<String,AMX> proxyMap  = proxyFactory.toProxyMap( objectNameMap );
          proxyMaps.put( j2eeType, proxyMap );  
        }
       
        result  = proxyMaps;
      }
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.client.ProxyFactory

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.