001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036:
037: package com.sun.xml.ws.api.server;
038:
039: import com.sun.istack.NotNull;
040: import com.sun.xml.ws.api.pipe.Pipe;
041: import com.sun.xml.ws.api.pipe.ServerPipeAssemblerContext;
042: import com.sun.xml.ws.api.pipe.helper.AbstractFilterPipeImpl;
043:
044: /**
045: * Allow the container (primarily Glassfish) to inject
046: * their own pipes into the pipeline.
047: *
048: * <p>
049: * This interface has a rather ad-hoc set of methods, because
050: * we didn't want to define an autonomous pipe-assembly process.
051: * (We thought this is a smaller evil compared to that.)
052: *
053: * <p>
054: * JAX-WS obtains this through {@link Container#getSPI(Class)}.
055: *
056: * @author Kohsuke Kawaguchi
057: */
058: public abstract class ServerPipelineHook {
059: /**
060: * Called during the pipeline construction process once to allow a container
061: * to register a pipe for monitoring.
062: *
063: * This pipe will be injected to a point very close to the transport, allowing
064: * it to measure the time it takes for processing as well as detecting errors.
065: *
066: * @param ctxt
067: * Represents abstraction of SEI, WSDL abstraction etc. Context can be used
068: * whether add a new pipe to the head or not.
069: *
070: * @param tail
071: * Head of the partially constructed pipeline. If the implementation
072: * wishes to add new pipes, it should do so by extending
073: * {@link AbstractFilterPipeImpl} and making sure that this {@link Pipe}
074: * eventually processes messages.
075: *
076: * @return
077: * The default implementation just returns <tt>tail</tt>, which means
078: * no additional pipe is inserted. If the implementation adds
079: * new pipes, return the new head pipe.
080: */
081: public @NotNull
082: Pipe createMonitoringPipe(ServerPipeAssemblerContext ctxt, @NotNull
083: Pipe tail) {
084: return tail;
085: }
086:
087: /**
088: * Called during the pipeline construction process once to allow a container
089: * to register a pipe for security.
090: *
091: * This pipe will be injected to a point very close to the transport, allowing
092: * it to do some security operations.
093: *
094: * @param ctxt
095: * Represents abstraction of SEI, WSDL abstraction etc. Context can be used
096: * whether add a new pipe to the head or not.
097: *
098: * @param tail
099: * Head of the partially constructed pipeline. If the implementation
100: * wishes to add new pipes, it should do so by extending
101: * {@link AbstractFilterPipeImpl} and making sure that this {@link Pipe}
102: * eventually processes messages.
103: *
104: * @return
105: * The default implementation just returns <tt>tail</tt>, which means
106: * no additional pipe is inserted. If the implementation adds
107: * new pipes, return the new head pipe.
108: */
109: public @NotNull
110: Pipe createSecurityPipe(ServerPipeAssemblerContext ctxt, @NotNull
111: Pipe tail) {
112: return tail;
113: }
114: }
|