知识库tomcat+service(63)

2016-12-28 08:58

Service
The org.apache.catalina.service interface represents a service.

    public interface Service{
        public Container getContainer();
        public void setContainer(Container container);
        public String getInfo();
        public void setName(String name);
        public Server getServer();
        //set the server with which we are associated
        public void setServer(Server server);
        public void addConnector(Connector connector);
        public Connector[] findConnectors();
        public void removeConnector(Connector connector);
        public void initialize()throws LifecycleException;
    }

StandardService class’s initialize method initializes all the connectors added to the service. Its start method starts the container and all the connectors.