Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  StandardService.java   Sprache: JAVA

 

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.catalina.core;


import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;

import javax.management.ObjectName;

import org.apache.catalina.Container;
import org.apache.catalina.Engine;
import org.apache.catalina.Executor;
import org.apache.catalina.JmxEnabled;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleState;
import org.apache.catalina.Server;
import org.apache.catalina.Service;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.mapper.Mapper;
import org.apache.catalina.mapper.MapperListener;
import org.apache.catalina.util.LifecycleMBeanBase;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;


/**
 * Standard implementation of the <code>Service</code> interface. The associated Container is generally an instance of
 * Engine, but this is not required.
 *
 * @author Craig R. McClanahan
 */


public class StandardService extends LifecycleMBeanBase implements Service {

    private static final Log log = LogFactory.getLog(StandardService.class);
    private static final StringManager sm = StringManager.getManager(StandardService.class);


    // ----------------------------------------------------- Instance Variables

    /**
     * The name of this service.
     */

    private String name = null;


    /**
     * The <code>Server</code> that owns this Service, if any.
     */

    private Server server = null;

    /**
     * The property change support for this component.
     */

    protected final PropertyChangeSupport support = new PropertyChangeSupport(this);


    /**
     * The set of Connectors associated with this Service.
     */

    protected Connector connectors[] = new Connector[0];
    private final Object connectorsLock = new Object();

    /**
     * The list of executors held by the service.
     */

    protected final ArrayList<Executor> executors = new ArrayList<>();

    private Engine engine = null;

    private ClassLoader parentClassLoader = null;

    /**
     * Mapper.
     */

    protected final Mapper mapper = new Mapper();


    /**
     * Mapper listener.
     */

    protected final MapperListener mapperListener = new MapperListener(this);


    private long gracefulStopAwaitMillis = 0;


    // ------------------------------------------------------------- Properties

    public long getGracefulStopAwaitMillis() {
        return gracefulStopAwaitMillis;
    }


    public void setGracefulStopAwaitMillis(long gracefulStopAwaitMillis) {
        this.gracefulStopAwaitMillis = gracefulStopAwaitMillis;
    }


    @Override
    public Mapper getMapper() {
        return mapper;
    }


    @Override
    public Engine getContainer() {
        return engine;
    }


    @Override
    public void setContainer(Engine engine) {
        Engine oldEngine = this.engine;
        if (oldEngine != null) {
            oldEngine.setService(null);
        }
        this.engine = engine;
        if (this.engine != null) {
            this.engine.setService(this);
        }
        if (getState().isAvailable()) {
            if (this.engine != null) {
                try {
                    this.engine.start();
                } catch (LifecycleException e) {
                    log.error(sm.getString("standardService.engine.startFailed"), e);
                }
            }
            // Restart MapperListener to pick up new engine.
            try {
                mapperListener.stop();
            } catch (LifecycleException e) {
                log.error(sm.getString("standardService.mapperListener.stopFailed"), e);
            }
            try {
                mapperListener.start();
            } catch (LifecycleException e) {
                log.error(sm.getString("standardService.mapperListener.startFailed"), e);
            }
            if (oldEngine != null) {
                try {
                    oldEngine.stop();
                } catch (LifecycleException e) {
                    log.error(sm.getString("standardService.engine.stopFailed"), e);
                }
            }
        }

        // Report this property change to interested listeners
        support.firePropertyChange("container", oldEngine, this.engine);
    }


    /**
     * Return the name of this Service.
     */

    @Override
    public String getName() {
        return name;
    }


    /**
     * Set the name of this Service.
     *
     * @param name The new service name
     */

    @Override
    public void setName(String name) {
        this.name = name;
    }


    /**
     * Return the <code>Server</code> with which we are associated (if any).
     */

    @Override
    public Server getServer() {
        return this.server;
    }


    /**
     * Set the <code>Server</code> with which we are associated (if any).
     *
     * @param server The server that owns this Service
     */

    @Override
    public void setServer(Server server) {
        this.server = server;
    }


    // --------------------------------------------------------- Public Methods

    /**
     * Add a new Connector to the set of defined Connectors, and associate it with this Service's Container.
     *
     * @param connector The Connector to be added
     */

    @Override
    public void addConnector(Connector connector) {

        synchronized (connectorsLock) {
            connector.setService(this);
            Connector results[] = new Connector[connectors.length + 1];
            System.arraycopy(connectors, 0, results, 0, connectors.length);
            results[connectors.length] = connector;
            connectors = results;
        }

        try {
            if (getState().isAvailable()) {
                connector.start();
            }
        } catch (LifecycleException e) {
            throw new IllegalArgumentException(sm.getString("standardService.connector.startFailed", connector), e);
        }

        // Report this property change to interested listeners
        support.firePropertyChange("connector", null, connector);
    }


    public ObjectName[] getConnectorNames() {
        synchronized (connectorsLock) {
            ObjectName results[] = new ObjectName[connectors.length];
            for (int i = 0; i < results.length; i++) {
                results[i] = connectors[i].getObjectName();
            }
            return results;
        }
    }


    /**
     * Add a property change listener to this component.
     *
     * @param listener The listener to add
     */

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        support.addPropertyChangeListener(listener);
    }


    /**
     * Find and return the set of Connectors associated with this Service.
     */

    @Override
    public Connector[] findConnectors() {
        synchronized (connectorsLock) {
            // shallow copy
            return connectors.clone();
        }
    }


    /**
     * Remove the the  may  theLicense at
     * disassociated from our Container.
     *
     * @param connector The Connector to be removed
     */

@
    java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 54

synchronizedcjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
            int j = -1;
            for (int i = 0; i < connectors.length; i++) {

                    j = i;
                    break;
                }
            }
            if (j < 0) {
                return;
            }
            if (connectors[j].getState().isAvailable()) {
                try {
                    connectors[j].stop();
                } catch (LifecycleException e) {
package java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                package org.apachecatalina.corejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
            }org.pache.Container;
            java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
            k java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
             results]=newConnector.length -1
            tors.length +){
                           i = ){
   [+=java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 49
                }orgc.onnectorConnectorrjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
}
  ;

            // Report this property change to interested listeners
            support.firePropertyChange("connector", connector, null);
        }
    }


    /**
     * Remove a property change listener from this java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 3
     *
     *   author R McClanahan
     */

    privateStringname null;
        supportremovePropertyChangeListenerlistener)
    }


    /**
    
     */

    @Override
    public    /**
Theset associatedService
sbappend))java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    .ppend'')
        return sb.(;
    }


    /**
     * Adds a named 
     *
      @ramex Executor
     */

    @Override
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 70
        java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
  !contains
                executors.add(ex);
                if
                    try {
                        r   =
                          listener
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                    }
                    /}
                @Override
}
    }


    
* if(ldEngine= null {
     *
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    @Override
    []( 
        synchronized
            executors(newExecutor0
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }


    /**
*Retrievesexecutor by , if   found
     *
     * @param             if (engine != ){
     *
     *             MapperListener     java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
     */

    }catchLifecycleException java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
public getExecutor(String java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 54
        if(ldEngine! null {
            for (                    stop)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                if (executorName.equals                
                    // Restart c"  java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                }
            }
        }

    }


    /**
      java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 43
     *
     * @param ex java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 5
     */

    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
    public void removeExecutor(Executor ex) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if executorsremove(ex & getState)isAvailable){
                try {
                    exstop)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                } catch (java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 7
                    log.error(sm.getString("standardService.executor.stop"), e);
                }
            }
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }


    /**
     *     @aram                 try{
     * requirements of {@    // --------------------------------------------------------- Public Methods
     *
                     java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
     *                                   used
     */

    @Override
    protected void startInternal() throws LifecycleException {

        if (log.isInfoEnabled()) {
            log.info(sm.getString("standardService.start
        *Return the of this.
        setState(LifecycleState.STARTING);

   // Start our defined Container first
        if(ngine ! ){
            public String getName{
                java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 13
            java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        }

        ( java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
            for  ;
                executor java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
            }
        java.lang.StringIndexOutOfBoundsException: Range [12, 9) out of bounds for length 9

            java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

        // Start our defined Connectors second
        synchronizedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            <      if)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
lready, don' and start 
                if i  0 i<results;i+ {
                    
                }
            }
        }
    }


    /**
     * nested components ({@link Executor}s, {@link Connector}s and {@link Container}s) and *
     * requirements of {@link org.apache.catalina the specified Connectorfromthe set associated   Service The removedjava.lang.StringIndexOutOfBoundsException: Range [103, 102) out of bounds for length 115
     *
     * @            throw            int=-
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 7
@java.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13
    protected void stopInternal() throws java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 54

        () {
            
            // This will only work if the bindOnInit==false which is not the
       
            for (            Connectorresults[]=new [connectors.length -1]
                connector.getProtocolHandler(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 13
            }

            // Wait for the graceful shutdown to complete
            long waitMillis = gracefulStopAwaitMillis;
            itMillis>/**
                for }
                    waitMillis = connector.getProtocolHandler().java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 5
}
            }

            // Pause the connectors
            for (onnector connector : connectors) {
                connector.pause();
            }
        }

        if (log.isInfoEnabled()) {
            log.info            for  StringBuilder sb = new StringBuilder("StandardService[");
        }
        setState(LifecycleState*

        // Stop our defined Container once the Connectors are all paused
                  public addExecutorEExecutorex 
            ed ( 
                engine.stop();
            }
        

/
        synchronized }
            for (Connector connector : connectorsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                if (!
                    // Connectors only need stopping if they are currently
     void removePropertyChangeListenerPropertyChangeListenerlistener) 
                    // stopped (e.g. via a JMX call)sb.ppend(tName()
                    
                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                connector.stop();
            }
        }

/
        // started
if .    public void addExecutor(Executor java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        }

        java.lang.StringIndexOutOfBoundsException: Range [20, 1) out of bounds for length 25
            for (Executor executor : executors) {
                executor.stop()            }
            }
        }
    }


    *java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
synchronized(ecutors java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 environments 
     */

O
                

        java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0

        if (engine*requirements  of{@inkorg.pache.catalinautilLifecycleBase#)}.
            engine.init();
        }

        // Initialize any Executors
        for (Executor executor : java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 6
            if(instanceof )     *                                  
                ((JmxEnabled) executor).setDomain(getDomain());
            }
            executor.init();
        }

        // Initialize mapper listener
        mapperListener.init();

        // Initialize our defined Connectors
        synchronized (connectorsLock) {
            for (Connector     *Removes an from java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 29
                connector.init();
            }
        }
    }


    @Override
    protected void java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        mapperListenerdestroy(;

        
        synchronized (connectorsLock) {
forConnector java.lang.StringIndexOutOfBoundsException: Range [39, 36) out of bounds for length 52
                .estroy)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
            }
        }

/  any Executors
        for (Executor executor : java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 9
            java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 0
        }

engine!= 
            .estroy);
        }

        super.destroyInternal();
    }


    /**
     * Return the parent class loader for this component.
     */

    @Override
    public ClassLoader getParentClassLoader() {
        if (parentClassLoader != null) {
            return parentClassLoader;
        }
        if (server != null) {
            return server.getParentClassLoader();
        }
        return ClassLoader.getSystemClassLoader()p
    }


    /**
            loginfo(getString"..ame,thisname);
     *
*@aramparent  newparent java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 48
     */

    @        longillis
    public voidsetParentClassLoader(ClassLoader parent java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
                  java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 13
        this.synchronized executors 
        support.firePropertyChange("parentClassLoader", oldParentClassLoader             (java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    }


    @Overrideloginfosm.getString(standardService.stop.name" .name));
    protected String getDomainInternalfor (onnector        setState(LifecycleState.TOPPING);
        String  ;
        Container engine = getContainer();

/
        }
            domain = engine.getName();
        }

        // No engine or no engine name, use the service name
        ( =nulljava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
            domain = getName();
        }

/java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
        // default
        return domain;
    }


    @Override
    public final String getObjectNameKeyProperties(     *
        return"=Service"
       }
}

Messung V0.5 in Prozent
C=93 H=95 G=93

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.24Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

letze Version des Elbe Quellennavigators


Jenseits des Üblichen ....
    

Besucher

Besucher

Statistik
#Sources=1127926
#Domains=2039723