Package org.cyclopsgroup.jmxterm

Examples of org.cyclopsgroup.jmxterm.Session


    private String type = "aon";

    private void displayAttributes( MBeanInfo info )
    {
        Session session = getSession();
        MBeanAttributeInfo[] attrInfos = info.getAttributes();
        if ( attrInfos.length == 0 )
        {
            session.output.printMessage( "there is no attribute" );
            return;
View Full Code Here


        }
    }

    private void displayNotifications( MBeanInfo info )
    {
        Session session = getSession();
        MBeanNotificationInfo[] notificationInfos = info.getNotifications();
        if ( notificationInfos.length == 0 )
        {
            session.output.printMessage( "there's no notifications" );
            return;
View Full Code Here

    }

    private void displayOperations( MBeanInfo info )
    {
        Session session = getSession();
        MBeanOperationInfo[] operationInfos = info.getOperations();
        if ( operationInfos.length == 0 )
        {
            session.output.printMessage( "there's no operations" );
            return;
View Full Code Here

     */
    @Override
    public void execute()
        throws IOException, JMException
    {
        Session session = getSession();
        String beanName = BeanCommand.getBeanName( bean, domain, session );
        if ( beanName == null )
        {
            throw new IllegalArgumentException( "Please specify a bean using either -b option or bean command" );
        }
        ObjectName name = new ObjectName( beanName );
        MBeanServerConnection con = session.getConnection().getServerConnection();
        MBeanInfo info = con.getMBeanInfo( name );
        session.output.printMessage( "mbean = " + beanName );
        session.output.printMessage( "class name = " + info.getClassName() );
        for ( char t : type.toCharArray() )
        {
View Full Code Here

    @SuppressWarnings( "unchecked" )
    private void displayAttributes()
        throws IOException, JMException
    {
        Session session = getSession();
        String beanName = BeanCommand.getBeanName( bean, domain, session );
        ObjectName name = new ObjectName( beanName );
        session.output.printMessage( "mbean = " + beanName + ":" );
        MBeanServerConnection con = session.getConnection().getServerConnection();
        MBeanAttributeInfo[] ais = con.getMBeanInfo( name ).getAttributes();
        Map<String, MBeanAttributeInfo> attributeNames =
            ListOrderedMap.decorate( new HashMap<String, MBeanAttributeInfo>() );
        if ( attributes.contains( "*" ) )
        {
View Full Code Here

    @SuppressWarnings( "unchecked" )
    @Override
    public void execute()
        throws IOException, JMException
    {
        Session session = getSession();
        // output predefined about properties
        ExtendedProperties props =
            ExtendedPropertiesUtils.loadFromOverlappingResources( "META-INF/cyclopsgroup/jmxterm.properties",
                                                                  getClass().getClassLoader() );
        ValueOutputFormat format = new ValueOutputFormat( 2, showDescription, true );
View Full Code Here

     */
    @Override
    public void execute()
        throws IOException, JMException
    {
        Session session = getSession();
        if ( bean == null )
        {
            if ( session.getBean() == null )
            {
                session.output.println( SyntaxUtils.NULL );
            }
            else
            {
                session.output.println( session.getBean() );
            }
            return;
        }
        String beanName = getBeanName( bean, domain, session );
        if ( beanName == null )
        {
            session.setBean( null );
            session.output.printMessage( "bean is unset" );
            return;
        }
        ObjectName name = new ObjectName( beanName );
        MBeanServerConnection con = session.getConnection().getServerConnection();
        con.getMBeanInfo( name );
        session.setBean( beanName );
        session.output.printMessage( "bean is set to " + beanName );
    }
View Full Code Here

     */
    @Override
    public void execute()
        throws MalformedObjectNameException, IOException, JMException
    {
        Session session = getSession();
        String beanName = BeanCommand.getBeanName( bean, domain, session );
        if ( beanName == null )
        {
            throw new IllegalArgumentException( "Please specify MBean to invoke either using -b option or bean command" );
        }

        ObjectName name = new ObjectName( beanName );
        if ( !listeners.containsKey( name ) )
        {
            MBeanServerConnection con = session.getConnection().getServerConnection();

            NotificationListener listener = new BeanNotificationListener();
            con.addNotificationListener( name, listener , null, null );
            listeners.put( name, listener );

View Full Code Here

    public class BeanNotificationListener implements NotificationListener {

        @Override
        public void handleNotification(Notification notification, Object handback) {

            Session session = getSession();

            StringBuilder sb = new StringBuilder("notification received: ");
            sb.append("timestamp=").append(notification.getTimeStamp());
            sb.append(",class=").append(notification.getClass().getName());
            sb.append(",source=").append(notification.getSource());
View Full Code Here

     */
    @Override
    public List<String> doSuggestArgument()
        throws IOException, JMException
    {
        Session session = getSession();
        if ( getSession().getBean() != null )
        {
            MBeanInfo info =
                session.getConnection().getServerConnection().getMBeanInfo( new ObjectName( session.getBean() ) );
            MBeanOperationInfo[] operationInfos = info.getOperations();
            List<String> ops = new ArrayList<String>( operationInfos.length );
            for ( MBeanOperationInfo op : operationInfos )
            {
                ops.add( op.getName() );
View Full Code Here

TOP

Related Classes of org.cyclopsgroup.jmxterm.Session

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.