⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serverccm.java

📁 直接放在eclipse环境下
💻 JAVA
字号:
/*====================================================================This file was produced by the OpenCCM ir3_java generator.OpenCCM: The Open CORBA Component Model PlatformCopyright (C) 2000-2002 USTL - LIFL - GOALContact: openccm-team@objectweb.orgThis library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 2.1 of the License, or any later version.This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307USAInitial developer(s): Philippe Merle, Mathieu Vadet.Contributor(s): ______________________________________.====================================================================*/package org.objectweb.ccm.demo3; /** **  Skeleton class for the ::demo3::Server component. **/public class ServerCCM       extends org.objectweb.openccm.Components.CCMObjectImpl       implements ServerOperations,                  org.objectweb.openccm.Containers.ComponentExecutor,                  CCM_Server_Context{    // ==================================================================    //    // Internal State.    //    // ===================================================================         /** Reference to the component servant. */    private org.objectweb.openccm.Containers.ComponentServant _servant;         /** Reference to the delegate. */    private CCM_Server_Executor _delegate;         /** Reference to the executor locator. */    private org.omg.Components.ExecutorLocator _locator;         // ==================================================================    //    // Constructor.    //    // ===================================================================         /**     **  The default constructor.     **/    public    ServerCCM()    {        _servant = null;        _delegate = null;        _locator = null;    }         // ==================================================================    //    // Internal methods.    //    // ===================================================================         // ==================================================================    //    // Public methods.    //    // ===================================================================         // ==================================================================    //    // Public methods inherited from the CCMObjectImpl class.    //    // ==================================================================         /**     **  To obtain the component executor.     **/    public org.objectweb.openccm.Containers.ComponentExecutor    _the_component_executor()    {        return this;    }         // ==================================================================    //    // Public methods for the ComponentExecutor interface.    //    // ==================================================================         /**     **  To obtain the component servant.     **/    public org.objectweb.openccm.Containers.ComponentServant    _component_servant()    {        return _servant;    }         /**     **  To set the component servant.     **  This operation also declares the ports of the component.     **/    public void    _component_servant(org.objectweb.openccm.Containers.ComponentServant servant)    {        _servant = servant;        _declare_port(new org.objectweb.openccm.Components.ProvidesInfo("IDL:ccm.objectweb.org/demo3/Server/the_service:1.0", "the_service", "IDL:ccm.objectweb.org/demo3/Services:1.0"));        _declare_port(new org.objectweb.openccm.Components.PublishesInfo("IDL:ccm.objectweb.org/demo3/Server/to_consumers:1.0", "to_consumers", "IDL:ccm.objectweb.org/demo3/TextEventConsumer:1.0"));    }         /**     **  To set the executor locator object for this skeleton.     **/    public void    _executor_locator(org.omg.Components.ExecutorLocator locator)    {        _locator = locator;    }         /**     **  To get the executor locator for this skeleton.     **/    public org.omg.Components.ExecutorLocator    _executor_locator()    {        return _locator;    }         /**     **  To set the delegate object for this skeleton.     **/    public void    _delegate(org.omg.Components.EnterpriseComponent delegate)    {        _delegate = (CCM_Server_Executor)delegate;    }         /**     **  To get the delegate object for this skeleton.     **/    public org.omg.Components.EnterpriseComponent    _delegate()    {        return _delegate;    }        // ==================================================================    //    // Public methods for the CCM_ServerContext interface.    //    // ==================================================================         //    //  IDL:ccm.objectweb.org/demo3/CCM_Server_Context/push_to_consumers:1.0    //    /**     **  Implementation of the ::demo3::CCM_Server_Context::push_to_consumers operation.     **/    public void    push_to_consumers(org.objectweb.ccm.demo3.TextEvent event)    {        try        {            org.omg.CORBA.Any any = org.omg.CORBA.ORB.init().create_any();            org.objectweb.ccm.demo3.TextEventHelper.insert(any, event);            _push("to_consumers",                  "TextEvent",                  any);        }        catch(Exception exc)        {            // Should not happen else this is a serious problem.            exc.printStackTrace(System.err);        }    }                // ==================================================================    //    // Public methods for the ServerOperations interface.    // Connection related operations part.    //    // ==================================================================         //    //  IDL:ccm.objectweb.org/demo3/Server/provide_the_service:1.0    //    /**     **  Implementation of the ::demo3::Server::provide_the_service operation.     **/    public org.objectweb.ccm.demo3.Services    provide_the_service()    {        try        {            return org.objectweb.ccm.demo3.ServicesHelper.narrow(provide_facet("the_service"));        }        catch(org.omg.Components.InvalidName ex)        {            // should not happen.        }        return null;    }            //    //  IDL:ccm.objectweb.org/demo3/Server/subscribe_to_consumers:1.0    //    /**     **  Implementation of the ::demo3::Server::subscribe_to_consumers operation.     **/    public org.omg.Components.Cookie    subscribe_to_consumers(org.objectweb.ccm.demo3.TextEventConsumer consumer)    throws org.omg.Components.ExceededConnectionLimit    {        try        {            return _subscribe("to_consumers", consumer);        }        catch(org.omg.Components.InvalidName ex)        {            // should not happen.        }        return null;    }            //    //  IDL:ccm.objectweb.org/demo3/Server/unsubscribe_to_consumers:1.0    //    /**     **  Implementation of the ::demo3::Server::unsubscribe_to_consumers operation.     **/    public org.objectweb.ccm.demo3.TextEventConsumer    unsubscribe_to_consumers(org.omg.Components.Cookie ck)    throws org.omg.Components.InvalidConnection    {        try        {            return org.objectweb.ccm.demo3.TextEventConsumerHelper.narrow(_unsubscribe("to_consumers", ck));        }        catch(org.omg.Components.InvalidName ex)        {            // should not happen.        }        return null;    }            // ==================================================================    //    // Public methods for the ServerOperations interface.    // Business operations part.    //    // ==================================================================         //    //  IDL:ccm.objectweb.org/demo3/NamedComponent/name:1.0    //    /**     **  Implementation of the ::demo3::NamedComponent::name attribute as accessor operation.     **/    public java.lang.String    name()    {        return _delegate.name();    }        /**     **  Implementation of the ::demo3::NamedComponent::name attribute as mutator operation.     **/    public void    name(java.lang.String val)    {        _delegate.name(val);    }        // ==================================================================    //    // Special case of the ::Components::CCMObject::configuration_complete operation.    //    // ==================================================================         //    //  IDL:omg.org/Components/CCMObject/configuration_complete:1.0    //    /**     **  Implementation of the ::Components::CCMObject::configuration_complete operation.     **/    public void    configuration_complete()    throws org.omg.Components.InvalidConfiguration    {        _delegate.configuration_complete();        // If no InvalidConfiguration exception is thrown by the component implementation        // then complete the configuration via the inherited CCMObjectImpl class.        super.configuration_complete();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -