alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
* <TR> * <TR> * <TR> * <TR> * </TABLE> * <p> * The <CODE>STARTING state marks the transition from OFFLINE to * <CODE>ONLINE. * <p> * The <CODE>STOPPING state marks the transition from ONLINE to * <CODE>OFFLINE. This occurs when the CommunicatorServer is * finishing or interrupting active requests. * <p> * A <CODE>CommunicatorServer may serve several clients concurrently. The * number of concurrent clients can be limited using the property * <CODE>maxActiveClientCount. The default value of this property is * defined by the subclasses. * <p> * When a <CODE>CommunicatorServer is unregistered from the MBeanServer, * it is stopped automatically. * * <p>This API is a Sun Microsystems internal API and is subject * to change without notice.</b>

*/ public interface CommunicatorServerMBean { /** * Starts this <CODE>CommunicatorServer. * <p> * Has no effect if this <CODE>CommunicatorServer is ONLINE or * <CODE>STOPPING. */ public void start() ; /** * Stops this <CODE>CommunicatorServer. * <p> * Has no effect if this <CODE>CommunicatorServer is OFFLINE or * <CODE>STOPPING. */ public void stop() ; /** * Tests if the <CODE>CommunicatorServer is active. * * @return True if connector is <CODE>ONLINE; false otherwise. */ public boolean isActive() ; /** * Waits untill either the State attribute of this MBean equals the specified <VAR>state parameter, * or the specified <VAR>timeOut has elapsed. The method waitState returns with a boolean value indicating whether * the specified <VAR>state parameter equals the value of this MBean's State attribute at the time the method terminates. * * Two special cases for the <VAR>timeOut parameter value are: * <UL>
  • if timeOut is negative then waitState returns immediately (i.e. does not wait at all),
  • * <LI> if timeOut equals zero then waitState waits untill the value of this MBean's State attribute * is the same as the <VAR>state parameter (i.e. will wait indefinitely if this condition is never met). * * @param state The value of this MBean's State attribute * to wait for. <VAR>state can be one of: * <ul> * <li>CommunicatorServer.OFFLINE, * <li>CommunicatorServer.ONLINE, * <li>CommunicatorServer.STARTING, * <li>CommunicatorServer.STOPPING. * </ul> * @param timeOut The maximum time to wait for, in * milliseconds, if positive. * Infinite time out if 0, or no waiting at all if negative. * * @return true if the value of this MBean's State attribute is the * same as the <VAR>state parameter; false otherwise. */ public boolean waitState(int state , long timeOut) ; /** * Gets the state of this <CODE>CommunicatorServer as an integer. * * @return <CODE>ONLINE, OFFLINE, STARTING or STOPPING. */ public int getState() ; /** * Gets the state of this <CODE>CommunicatorServer as a string. * * @return One of the strings "ONLINE", "OFFLINE", "STARTING" or "STOPPING". */ public String getStateString() ; /** * Gets the host name used by this <CODE>CommunicatorServer. * * @return The host name used by this <CODE>CommunicatorServer. */ public String getHost() ; /** * Gets the port number used by this <CODE>CommunicatorServer. * * @return The port number used by this <CODE>CommunicatorServer. */ public int getPort() ; /** * Sets the port number used by this <CODE>CommunicatorServer. * * @param port The port number used by this <CODE>CommunicatorServer. * * @exception java.lang.IllegalStateException This method has been invoked * while the communicator was ONLINE or STARTING. */ public void setPort(int port) throws java.lang.IllegalStateException ; /** * Gets the protocol being used by this <CODE>CommunicatorServer. * @return The protocol as a string. */ public abstract String getProtocol() ; }

    Other Java examples (source code examples)

    Here is a short list of links related to this Java CommunicatorServerMBean.java source code file:

    Java example source code file (CommunicatorServerMBean.java)

    This example Java source code file (CommunicatorServerMBean.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

    Learn more about this Java project at its project page.

    Java - Java tags/keywords

    communicatorservermbean, string

    The CommunicatorServerMBean.java Java example source code

    /*
     * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
     * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     *
     * This code is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License version 2 only, as
     * published by the Free Software Foundation.  Oracle designates this
     * particular file as subject to the "Classpath" exception as provided
     * by Oracle in the LICENSE file that accompanied this code.
     *
     * This code is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     * version 2 for more details (a copy is included in the LICENSE file that
     * accompanied this code).
     *
     * You should have received a copy of the GNU General Public License version
     * 2 along with this work; if not, write to the Free Software Foundation,
     * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
     *
     * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
     * or visit www.oracle.com if you need additional information or have any
     * questions.
     */
    
    
    package com.sun.jmx.snmp.daemon;
    
    
    
    /**
     * Defines generic behaviour for the server
     * part of a connector or an adaptor. Most connectors or adaptors extend <CODE>CommunicatorServer
     * and inherit this behaviour. Connectors or adaptors that do not fit into this model do not extend
     * <CODE>CommunicatorServer.
     * <p>
     * An <CODE>CommunicatorServer is an active object, it listens for client requests
     * and processes them in its own thread. When necessary, a <CODE>CommunicatorServer
     * creates other threads to process multiple requests concurrently.
     * <p>
     * A <CODE>CommunicatorServer object can be stopped by calling the stop
     * method. When it is stopped, the <CODE>CommunicatorServer no longer listens to client
     * requests and no longer holds any thread or communication resources.
     * It can be started again by calling the <CODE>start method.
     * <p>
     * A <CODE>CommunicatorServer has a state property which reflects its
     * activity.
     * <p>
     * <TABLE>
     * <TR>
    CommunicatorServer State
    stopped OFFLINE
    starting STARTING
    running ONLINE
    stopping STOPPING
    ... this post is sponsored by my books ...

    #1 New Release!

    FP Best Seller

     

    new blog posts

     

    Copyright 1998-2021 Alvin Alexander, alvinalexander.com
    All Rights Reserved.

    A percentage of advertising revenue from
    pages under the /java/jwarehouse URI on this website is
    paid back to open source projects.