index int64 0 0 | repo_id stringlengths 9 205 | file_path stringlengths 31 246 | content stringlengths 1 12.2M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/annotation/HttpMethodConstraint.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 javax.servlet.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
* @since 3.0
*/
@Documented
@Retention(value= RetentionPolicy.RUNTIME)
public @interface HttpMethodConstraint {
/**
*
* @return http method name
*/
String value();
ServletSecurity.EmptyRoleSemantic emptyRoleSemantic() default ServletSecurity.EmptyRoleSemantic.PERMIT;
String[] rolesAllowed() default {};
ServletSecurity.TransportGuarantee transportGuarantee() default ServletSecurity.TransportGuarantee.NONE;
}
| 0 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/annotation/WebFilter.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 javax.servlet.annotation;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Documented;
import javax.servlet.DispatcherType;
/**
* @version $Rev$ $Date$
* @since 3.0
*/
@Documented
@Target(value= ElementType.TYPE)
@Retention(value= RetentionPolicy.RUNTIME)
public @interface WebFilter {
boolean asyncSupported() default false;
String description() default "";
DispatcherType[] dispatcherTypes() default DispatcherType.REQUEST;
String displayName() default "";
String filterName() default "";
WebInitParam[] initParams() default {};
String largeIcon() default "";
String[] servletNames() default {};
String smallIcon() default "";
String[] urlPatterns() default {};
String[] value() default {};
}
| 1 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpServletRequest.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 javax.servlet.http;
import java.io.IOException;
import java.util.Collection;
import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
/**
* Extends the {@link javax.servlet.ServletRequest} interface
* to provide request information for HTTP servlets.
* <p/>
* <p>The servlet container creates an <code>HttpServletRequest</code>
* object and passes it as an argument to the servlet's service
* methods (<code>doGet</code>, <code>doPost</code>, etc).
*
* @version $Rev$ $Date$
*/
public interface HttpServletRequest extends ServletRequest {
/**
* String identifier for Basic authentication. Value "BASIC"
*/
String BASIC_AUTH = "BASIC";
/**
* String identifier for Form authentication. Value "FORM"
*/
String FORM_AUTH = "FORM";
/**
* String identifier for Client Certificate authentication. Value "CLIENT_CERT"
*/
String CLIENT_CERT_AUTH = "CLIENT_CERT";
/**
* String identifier for Digest authentication. Value "DIGEST"
*/
String DIGEST_AUTH = "DIGEST";
/**
* authenticate user using container facilities
*
* @param response response to use to conduct a dialog if necessary
* @return whether authentication was successful
* @throws javax.servlet.ServletException if something goes wrong
* @throws java.io.IOException if something IO related goes wrong
* @since 3.0
*/
boolean authenticate(HttpServletResponse response) throws IOException, ServletException;
/**
* Returns the name of the authentication scheme used to protect
* the servlet. All servlet containers support basic, form and client
* certificate authentication, and may additionally support digest
* authentication.
* If the servlet is not authenticated <code>null</code> is returned.
* <p/>
* <p>Same as the value of the CGI variable AUTH_TYPE.
*
* @return one of the static members BASIC_AUTH,
* FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH
* (suitable for == comparison) or
* the container-specific string indicating
* the authentication scheme, or
* <code>null</code> if the request was
* not authenticated.
*/
String getAuthType();
/**
* Returns the portion of the request URI that indicates the context
* of the request. The context path always comes first in a request
* URI. The path starts with a "/" character but does not end with a "/"
* character. For servlets in the default (root) context, this method
* returns "". The container does not decode this string.
*
* @return a <code>String</code> specifying the
* portion of the request URI that indicates the context
* of the request
*/
String getContextPath();
/**
* Returns an array containing all of the <code>Cookie</code>
* objects the client sent with this request.
* This method returns <code>null</code> if no cookies were sent.
*
* @return an array of all the <code>Cookies</code>
* included with this request, or <code>null</code>
* if the request has no cookies
*/
Cookie[] getCookies();
/**
* Returns the value of the specified request header
* as a <code>long</code> value that represents a
* <code>Date</code> object. Use this method with
* headers that contain dates, such as
* <code>If-Modified-Since</code>.
* <p/>
* <p>The date is returned as
* the number of milliseconds since January 1, 1970 GMT.
* The header name is case insensitive.
* <p/>
* <p>If the request did not have a header of the
* specified name, this method returns -1. If the header
* can't be converted to a date, the method throws
* an <code>IllegalArgumentException</code>.
*
* @param name a <code>String</code> specifying the
* name of the header
* @return a <code>long</code> value
* representing the date specified
* in the header expressed as
* the number of milliseconds
* since January 1, 1970 GMT,
* or -1 if the named header
* was not included with the
* request
* @throws IllegalArgumentException If the header value
* can't be converted
* to a date
*/
long getDateHeader(String name);
/**
* Returns the value of the specified request header
* as a <code>String</code>. If the request did not include a header
* of the specified name, this method returns <code>null</code>.
* If there are multiple headers with the same name, this method
* returns the first head in the request.
* The header name is case insensitive. You can use
* this method with any request header.
*
* @param name a <code>String</code> specifying the
* header name
* @return a <code>String</code> containing the
* value of the requested
* header, or <code>null</code>
* if the request does not
* have a header of that name
*/
String getHeader(String name);
/**
* Returns an enumeration of all the header names
* this request contains. If the request has no
* headers, this method returns an empty enumeration.
* <p/>
* <p>Some servlet containers do not allow
* servlets to access headers using this method, in
* which case this method returns <code>null</code>
*
* @return an enumeration of all the
* header names sent with this
* request; if the request has
* no headers, an empty enumeration;
* if the servlet container does not
* allow servlets to use this method,
* <code>null</code>
*/
Enumeration<String> getHeaderNames();
/**
* Returns all the values of the specified request header
* as an <code>Enumeration</code> of <code>String</code> objects.
* <p/>
* <p>Some headers, such as <code>Accept-Language</code> can be sent
* by clients as several headers each with a different value rather than
* sending the header as a comma separated list.
* <p/>
* <p>If the request did not include any headers
* of the specified name, this method returns an empty
* <code>Enumeration</code>.
* The header name is case insensitive. You can use
* this method with any request header.
*
* @param name a <code>String</code> specifying the
* header name
* @return an <code>Enumeration</code> containing
* the values of the requested header. If
* the request does not have any headers of
* that name return an empty
* enumeration. If
* the container does not allow access to
* header information, return null
*/
Enumeration<String> getHeaders(String name);
/**
* Returns the value of the specified request header
* as an <code>int</code>. If the request does not have a header
* of the specified name, this method returns -1. If the
* header cannot be converted to an integer, this method
* throws a <code>NumberFormatException</code>.
* <p/>
* <p>The header name is case insensitive.
*
* @param name a <code>String</code> specifying the name
* of a request header
* @return an integer expressing the value
* of the request header or -1
* if the request doesn't have a
* header of this name
* @throws NumberFormatException If the header value
* can't be converted
* to an <code>int</code>
*/
int getIntHeader(String name);
/**
* Returns the name of the HTTP method with which this
* request was made, for example, GET, POST, or PUT.
* Same as the value of the CGI variable REQUEST_METHOD.
*
* @return a <code>String</code>
* specifying the name
* of the method with which
* this request was made
*/
String getMethod();
/**
* @param name part name
* @return named part
* @throws java.io.IOException if something IO related goes wrong
* @throws javax.servlet.ServletException if something goes wrong
* @since 3.0
*/
Part getPart(String name) throws IOException, ServletException;
/**
* @return all the parts
* @throws java.io.IOException if something IO related goes wrong
* @throws javax.servlet.ServletException if something goes wrong
* @since 3.0
*/
Collection<Part> getParts() throws IOException, ServletException;
/**
* Returns any extra path information associated with
* the URL the client sent when it made this request.
* The extra path information follows the servlet path
* but precedes the query string and will start with
* a "/" character.
* <p/>
* <p>This method returns <code>null</code> if there
* was no extra path information.
* <p/>
* <p>Same as the value of the CGI variable PATH_INFO.
*
* @return a <code>String</code>, decoded by the
* web container, specifying
* extra path information that comes
* after the servlet path but before
* the query string in the request URL;
* or <code>null</code> if the URL does not have
* any extra path information
*/
String getPathInfo();
/**
* Returns any extra path information after the servlet name
* but before the query string, and translates it to a real
* path. Same as the value of the CGI variable PATH_TRANSLATED.
* <p/>
* <p>If the URL does not have any extra path information,
* this method returns <code>null</code> or the servlet container
* cannot translate the virtual path to a real path for any reason
* (such as when the web application is executed from an archive).
* <p/>
* The web container does not decode this string.
*
* @return a <code>String</code> specifying the
* real path, or <code>null</code> if
* the URL does not have any extra path
* information
*/
String getPathTranslated();
/**
* Returns the query string that is contained in the request
* URL after the path. This method returns <code>null</code>
* if the URL does not have a query string. Same as the value
* of the CGI variable QUERY_STRING.
*
* @return a <code>String</code> containing the query
* string or <code>null</code> if the URL
* contains no query string. The value is not
* decoded by the container.
*/
String getQueryString();
/**
* Returns the login of the user making this request, if the
* user has been authenticated, or <code>null</code> if the user
* has not been authenticated.
* Whether the user name is sent with each subsequent request
* depends on the browser and type of authentication. Same as the
* value of the CGI variable REMOTE_USER.
*
* @return a <code>String</code> specifying the login
* of the user making this request, or <code>null</code>
* if the user login is not known
*/
String getRemoteUser();
/**
* Returns the session ID specified by the client. This may
* not be the same as the ID of the current valid session
* for this request.
* If the client did not specify a session ID, this method returns
* <code>null</code>.
*
* @return a <code>String</code> specifying the session
* ID, or <code>null</code> if the request did
* not specify a session ID
* @see #isRequestedSessionIdValid
*/
String getRequestedSessionId();
/**
* Returns the part of this request's URL from the protocol
* name up to the query string in the first line of the HTTP request.
* The web container does not decode this String.
* For example:
* <p/>
* <p/>
* <table summary="Examples of Returned Values">
* <tr align=left><th>First line of HTTP request </th>
* <th> Returned Value</th>
* <tr><td>POST /some/path.html HTTP/1.1<td><td>/some/path.html
* <tr><td>GET http://foo.bar/a.html HTTP/1.0
* <td><td>/a.html
* <tr><td>HEAD /xyz?a=b HTTP/1.1<td><td>/xyz
* </table>
* <p/>
* <p>To reconstruct an URL with a scheme and host, use
* {@link HttpUtils#getRequestURL}.
*
* @return a <code>String</code> containing
* the part of the URL from the
* protocol name up to the query string
* @see HttpUtils#getRequestURL
*/
String getRequestURI();
/**
* Reconstructs the URL the client used to make the request.
* The returned URL contains a protocol, server name, port
* number, and server path, but it does not include query
* string parameters.
* <p/>
* <p>Because this method returns a <code>StringBuffer</code>,
* not a string, you can modify the URL easily, for example,
* to append query parameters.
* <p/>
* <p>This method is useful for creating redirect messages
* and for reporting errors.
*
* @return a <code>StringBuffer</code> object containing
* the reconstructed URL
*/
StringBuffer getRequestURL();
/**
* Returns the part of this request's URL that calls
* the servlet. This path starts with a "/" character
* and includes either the servlet name or a path to
* the servlet, but does not include any extra path
* information or a query string. Same as the value of
* the CGI variable SCRIPT_NAME.
* <p/>
* <p>This method will return an empty string ("") if the
* servlet used to process this request was matched using
* the "/*" pattern.
*
* @return a <code>String</code> containing
* the name or path of the servlet being
* called, as specified in the request URL,
* decoded, or an empty string if the servlet
* used to process the request is matched
* using the "/*" pattern.
*/
String getServletPath();
/**
* Returns the current session associated with this request,
* or if the request does not have a session, creates one.
*
* @return the <code>HttpSession</code> associated
* with this request
* @see #getSession(boolean)
*/
HttpSession getSession();
/**
* Returns the current <code>HttpSession</code>
* associated with this request or, if there is no
* current session and <code>create</code> is true, returns
* a new session.
* <p/>
* <p>If <code>create</code> is <code>false</code>
* and the request has no valid <code>HttpSession</code>,
* this method returns <code>null</code>.
* <p/>
* <p>To make sure the session is properly maintained,
* you must call this method before
* the response is committed. If the container is using cookies
* to maintain session integrity and is asked to create a new session
* when the response is committed, an IllegalStateException is thrown.
*
* @param create <code>true</code> to create
* a new session for this request if necessary;
* <code>false</code> to return <code>null</code>
* if there's no current session
* @return the <code>HttpSession</code> associated
* with this request or <code>null</code> if
* <code>create</code> is <code>false</code>
* and the request has no valid session
* @see #getSession()
*/
HttpSession getSession(boolean create);
/**
* Returns a <code>java.security.Principal</code> object containing
* the name of the current authenticated user. If the user has not been
* authenticated, the method returns <code>null</code>.
*
* @return a <code>java.security.Principal</code> containing
* the name of the user making this request;
* <code>null</code> if the user has not been
* authenticated
*/
java.security.Principal getUserPrincipal();
/**
* Checks whether the requested session ID came in as a cookie.
*
* @return <code>true</code> if the session ID
* came in as a
* cookie; otherwise, <code>false</code>
* @see #getSession
*/
boolean isRequestedSessionIdFromCookie();
/**
* @deprecated As of Version 2.1 of the Java Servlet
* API, use {@link #isRequestedSessionIdFromURL}
* instead.
*/
boolean isRequestedSessionIdFromUrl();
/**
* Checks whether the requested session ID came in as part of the
* request URL.
*
* @return <code>true</code> if the session ID
* came in as part of a URL; otherwise,
* <code>false</code>
* @see #getSession
*/
boolean isRequestedSessionIdFromURL();
/**
* Checks whether the requested session ID is still valid.
*
* @return <code>true</code> if this
* request has an id for a valid session
* in the current session context;
* <code>false</code> otherwise
* @see #getRequestedSessionId
* @see #getSession
* @see HttpSessionContext
*/
boolean isRequestedSessionIdValid();
/**
* Returns a boolean indicating whether the authenticated user is included
* in the specified logical "role". Roles and role membership can be
* defined using deployment descriptors. If the user has not been
* authenticated, the method returns <code>false</code>.
*
* @param role a <code>String</code> specifying the name
* of the role
* @return a <code>boolean</code> indicating whether
* the user making this request belongs to a given role;
* <code>false</code> if the user has not been
* authenticated
*/
boolean isUserInRole(String role);
/**
* @param username username
* @param password password
* @since 3.0
* @throws javax.servlet.ServletException if username/password authentication not supported,
* if a user has already been established, or if authentication fails.
*/
void login(String username, String password) throws ServletException;
/**
* @since 3.0
* @throws javax.servlet.ServletException if logout fails
*/
void logout() throws ServletException;
}
| 2 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpSessionContext.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 javax.servlet.http;
import java.util.Enumeration;
/**
* @version $Rev$ $Date$
* @see HttpSession
* @see HttpSessionBindingEvent
* @see HttpSessionBindingListener
* @deprecated As of Java(tm) Servlet API 2.1
* for security reasons, with no replacement.
* This interface will be removed in a future
* version of this API.
*/
public interface HttpSessionContext {
/**
* @deprecated As of Java Servlet API 2.1 with
* no replacement. This method must
* return null and will be removed in
* a future version of this API.
*/
HttpSession getSession(String sessionId);
/**
* @deprecated As of Java Servlet API 2.1 with
* no replacement. This method must return
* an empty <code>Enumeration</code> and will be removed
* in a future version of this API.
*/
Enumeration<String> getIds();
}
| 3 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpServletResponseWrapper.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 javax.servlet.http;
import java.io.IOException;
import java.util.Collection;
import javax.servlet.ServletResponseWrapper;
/**
* Provides a convenient implementation of the HttpServletResponse interface that
* can be subclassed by developers wishing to adapt the response from a Servlet.
* This class implements the Wrapper or Decorator pattern. Methods default to
* calling through to the wrapped response object.
*
* @version $Rev$ $Date$
* @since v 2.3
* @see javax.servlet.http.HttpServletResponse
*/
public class HttpServletResponseWrapper extends ServletResponseWrapper implements HttpServletResponse {
/**
* Constructs a response adaptor wrapping the given response.
*
* @param response response to wrap
* @throws java.lang.IllegalArgumentException
* if the response is null
*/
public HttpServletResponseWrapper(HttpServletResponse response) {
super(response);
}
private HttpServletResponse getHttpServletResponse() {
return (HttpServletResponse) super.getResponse();
}
/**
* The default behavior of this method is to call addCookie(Cookie cookie)
* on the wrapped response object.
*/
public void addCookie(Cookie cookie) {
getHttpServletResponse().addCookie(cookie);
}
/**
* The default behavior of this method is to call containsHeader(String name)
* on the wrapped response object.
*/
public boolean containsHeader(String name) {
return getHttpServletResponse().containsHeader(name);
}
/**
* The default behavior of this method is to call encodeURL(String url)
* on the wrapped response object.
*/
public String encodeURL(String url) {
return getHttpServletResponse().encodeURL(url);
}
/**
* The default behavior of this method is to return encodeRedirectURL(String url)
* on the wrapped response object.
*/
public String encodeRedirectURL(String url) {
return getHttpServletResponse().encodeRedirectURL(url);
}
/**
* The default behavior of this method is to call encodeUrl(String url)
* on the wrapped response object.
*/
public String encodeUrl(String url) {
return getHttpServletResponse().encodeUrl(url);
}
/**
* The default behavior of this method is to return encodeRedirectUrl(String url)
* on the wrapped response object.
*/
public String encodeRedirectUrl(String url) {
return getHttpServletResponse().encodeRedirectUrl(url);
}
public String getHeader(String name) {
return getHttpServletResponse().getHeader(name);
}
public Collection<String> getHeaderNames() {
return getHttpServletResponse().getHeaderNames();
}
public Collection<String> getHeaders(String headerName) {
return getHttpServletResponse().getHeaders(headerName);
}
public int getStatus() {
return getHttpServletResponse().getStatus();
}
/**
* The default behavior of this method is to call sendError(int sc, String msg)
* on the wrapped response object.
*/
public void sendError(int sc, String msg) throws IOException {
getHttpServletResponse().sendError(sc, msg);
}
/**
* The default behavior of this method is to call sendError(int sc)
* on the wrapped response object.
*/
public void sendError(int sc) throws IOException {
getHttpServletResponse().sendError(sc);
}
/**
* The default behavior of this method is to return sendRedirect(String location)
* on the wrapped response object.
*/
public void sendRedirect(String location) throws IOException {
getHttpServletResponse().sendRedirect(location);
}
/**
* The default behavior of this method is to call setDateHeader(String name, long date)
* on the wrapped response object.
*/
public void setDateHeader(String name, long date) {
getHttpServletResponse().setDateHeader(name, date);
}
/**
* The default behavior of this method is to call addDateHeader(String name, long date)
* on the wrapped response object.
*/
public void addDateHeader(String name, long date) {
getHttpServletResponse().addDateHeader(name, date);
}
/**
* The default behavior of this method is to return setHeader(String name, String value)
* on the wrapped response object.
*/
public void setHeader(String name, String value) {
getHttpServletResponse().setHeader(name, value);
}
/**
* The default behavior of this method is to return addHeader(String name, String value)
* on the wrapped response object.
*/
public void addHeader(String name, String value) {
getHttpServletResponse().addHeader(name, value);
}
/**
* The default behavior of this method is to call setIntHeader(String name, int value)
* on the wrapped response object.
*/
public void setIntHeader(String name, int value) {
getHttpServletResponse().setIntHeader(name, value);
}
/**
* The default behavior of this method is to call addIntHeader(String name, int value)
* on the wrapped response object.
*/
public void addIntHeader(String name, int value) {
getHttpServletResponse().addIntHeader(name, value);
}
/**
* The default behavior of this method is to call setStatus(int sc)
* on the wrapped response object.
*/
public void setStatus(int sc) {
getHttpServletResponse().setStatus(sc);
}
/**
* The default behavior of this method is to call setStatus(int sc, String sm)
* on the wrapped response object.
*/
public void setStatus(int sc, String sm) {
getHttpServletResponse().setStatus(sc, sm);
}
}
| 4 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpServletResponse.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 javax.servlet.http;
import java.io.IOException;
import java.util.Collection;
import javax.servlet.ServletResponse;
/**
* Extends the {@link ServletResponse} interface to provide HTTP-specific
* functionality in sending a response. For example, it has methods
* to access HTTP headers and cookies.
* <p/>
* <p>The servlet container creates an <code>HttpServletResponse</code> object
* and passes it as an argument to the servlet's service methods
* (<code>doGet</code>, <code>doPost</code>, etc).
*
* @version $Rev$ $Date$
* @see javax.servlet.ServletResponse
*/
public interface HttpServletResponse extends ServletResponse {
/*
* Server status codes; see RFC 2068.
*/
/**
* Status code (100) indicating the client can continue.
*/
int SC_CONTINUE = 100;
/**
* Status code (101) indicating the server is switching protocols
* according to Upgrade header.
*/
int SC_SWITCHING_PROTOCOLS = 101;
/**
* Status code (200) indicating the request succeeded normally.
*/
int SC_OK = 200;
/**
* Status code (201) indicating the request succeeded and created
* a new resource on the server.
*/
int SC_CREATED = 201;
/**
* Status code (202) indicating that a request was accepted for
* processing, but was not completed.
*/
int SC_ACCEPTED = 202;
/**
* Status code (203) indicating that the meta information presented
* by the client did not originate from the server.
*/
int SC_NON_AUTHORITATIVE_INFORMATION = 203;
/**
* Status code (204) indicating that the request succeeded but that
* there was no new information to return.
*/
int SC_NO_CONTENT = 204;
/**
* Status code (205) indicating that the agent <em>SHOULD</em> reset
* the document view which caused the request to be sent.
*/
int SC_RESET_CONTENT = 205;
/**
* Status code (206) indicating that the server has fulfilled
* the partial GET request for the resource.
*/
int SC_PARTIAL_CONTENT = 206;
/**
* Status code (300) indicating that the requested resource
* corresponds to any one of a set of representations, each with
* its own specific location.
*/
int SC_MULTIPLE_CHOICES = 300;
/**
* Status code (301) indicating that the resource has permanently
* moved to a new location, and that future references should use a
* new URI with their requests.
*/
int SC_MOVED_PERMANENTLY = 301;
/**
* Status code (302) indicating that the resource has temporarily
* moved to another location, but that future references should
* still use the original URI to access the resource.
* <p/>
* This definition is being retained for backwards compatibility.
* SC_FOUND is now the preferred definition.
*/
int SC_MOVED_TEMPORARILY = 302;
/**
* Status code (302) indicating that the resource reside
* temporarily under a different URI. Since the redirection might
* be altered on occasion, the client should continue to use the
* Request-URI for future requests.(HTTP/1.1) To represent the
* status code (302), it is recommended to use this variable.
*/
int SC_FOUND = 302;
/**
* Status code (303) indicating that the response to the request
* can be found under a different URI.
*/
int SC_SEE_OTHER = 303;
/**
* Status code (304) indicating that a conditional GET operation
* found that the resource was available and not modified.
*/
int SC_NOT_MODIFIED = 304;
/**
* Status code (305) indicating that the requested resource
* <em>MUST</em> be accessed through the proxy given by the
* <code><em>Location</em></code> field.
*/
int SC_USE_PROXY = 305;
/**
* Status code (307) indicating that the requested resource
* resides temporarily under a different URI. The temporary URI
* <em>SHOULD</em> be given by the <code><em>Location</em></code>
* field in the response.
*/
int SC_TEMPORARY_REDIRECT = 307;
/**
* Status code (400) indicating the request sent by the client was
* syntactically incorrect.
*/
int SC_BAD_REQUEST = 400;
/**
* Status code (401) indicating that the request requires HTTP
* authentication.
*/
int SC_UNAUTHORIZED = 401;
/**
* Status code (402) reserved for future use.
*/
int SC_PAYMENT_REQUIRED = 402;
/**
* Status code (403) indicating the server understood the request
* but refused to fulfill it.
*/
int SC_FORBIDDEN = 403;
/**
* Status code (404) indicating that the requested resource is not
* available.
*/
int SC_NOT_FOUND = 404;
/**
* Status code (405) indicating that the method specified in the
* <code><em>Request-Line</em></code> is not allowed for the resource
* identified by the <code><em>Request-URI</em></code>.
*/
int SC_METHOD_NOT_ALLOWED = 405;
/**
* Status code (406) indicating that the resource identified by the
* request is only capable of generating response entities which have
* content characteristics not acceptable according to the accept
* headers sent in the request.
*/
int SC_NOT_ACCEPTABLE = 406;
/**
* Status code (407) indicating that the client <em>MUST</em> first
* authenticate itself with the proxy.
*/
int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
/**
* Status code (408) indicating that the client did not produce a
* request within the time that the server was prepared to wait.
*/
int SC_REQUEST_TIMEOUT = 408;
/**
* Status code (409) indicating that the request could not be
* completed due to a conflict with the current state of the
* resource.
*/
int SC_CONFLICT = 409;
/**
* Status code (410) indicating that the resource is no longer
* available at the server and no forwarding address is known.
* This condition <em>SHOULD</em> be considered permanent.
*/
int SC_GONE = 410;
/**
* Status code (411) indicating that the request cannot be handled
* without a defined <code><em>Content-Length</em></code>.
*/
int SC_LENGTH_REQUIRED = 411;
/**
* Status code (412) indicating that the precondition given in one
* or more of the request-header fields evaluated to false when it
* was tested on the server.
*/
int SC_PRECONDITION_FAILED = 412;
/**
* Status code (413) indicating that the server is refusing to process
* the request because the request entity is larger than the server is
* willing or able to process.
*/
int SC_REQUEST_ENTITY_TOO_LARGE = 413;
/**
* Status code (414) indicating that the server is refusing to service
* the request because the <code><em>Request-URI</em></code> is longer
* than the server is willing to interpret.
*/
int SC_REQUEST_URI_TOO_LONG = 414;
/**
* Status code (415) indicating that the server is refusing to service
* the request because the entity of the request is in a format not
* supported by the requested resource for the requested method.
*/
int SC_UNSUPPORTED_MEDIA_TYPE = 415;
/**
* Status code (416) indicating that the server cannot serve the
* requested byte range.
*/
int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
/**
* Status code (417) indicating that the server could not meet the
* expectation given in the Expect request header.
*/
int SC_EXPECTATION_FAILED = 417;
/**
* Status code (500) indicating an error inside the HTTP server
* which prevented it from fulfilling the request.
*/
int SC_INTERNAL_SERVER_ERROR = 500;
/**
* Status code (501) indicating the HTTP server does not support
* the functionality needed to fulfill the request.
*/
int SC_NOT_IMPLEMENTED = 501;
/**
* Status code (502) indicating that the HTTP server received an
* invalid response from a server it consulted when acting as a
* proxy or gateway.
*/
int SC_BAD_GATEWAY = 502;
/**
* Status code (503) indicating that the HTTP server is
* temporarily overloaded, and unable to handle the request.
*/
int SC_SERVICE_UNAVAILABLE = 503;
/**
* Status code (504) indicating that the server did not receive
* a timely response from the upstream server while acting as
* a gateway or proxy.
*/
int SC_GATEWAY_TIMEOUT = 504;
/**
* Status code (505) indicating that the server does not support
* or refuses to support the HTTP protocol version that was used
* in the request message.
*/
int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
/**
* Adds the specified cookie to the response. This method can be called
* multiple times to set more than one cookie.
*
* @param cookie the Cookie to return to the client
*/
void addCookie(Cookie cookie);
/**
* Adds a response header with the given name and
* date-value. The date is specified in terms of
* milliseconds since the epoch. This method allows response headers
* to have multiple values.
*
* @param name the name of the header to set
* @param date the additional date value
* @see #setDateHeader
*/
void addDateHeader(String name, long date);
/**
* Adds a response header with the given name and value.
* This method allows response headers to have multiple values.
*
* @param name the name of the header
* @param value the additional header value If it contains
* octet string, it should be encoded
* according to RFC 2047
* (http://www.ietf.org/rfc/rfc2047.txt)
* @see #setHeader
*/
void addHeader(String name, String value);
/**
* Adds a response header with the given name and
* integer value. This method allows response headers to have multiple
* values.
*
* @param name the name of the header
* @param value the assigned integer value
* @see #setIntHeader
*/
void addIntHeader(String name, int value);
/**
* Returns a boolean indicating whether the named response header
* has already been set.
*
* @param name the header name
* @return <code>true</code> if the named response header
* has already been set;
* <code>false</code> otherwise
*/
boolean containsHeader(String name);
/**
* Encodes the specified URL by including the session ID in it,
* or, if encoding is not needed, returns the URL unchanged.
* The implementation of this method includes the logic to
* determine whether the session ID needs to be encoded in the URL.
* For example, if the browser supports cookies, or session
* tracking is turned off, URL encoding is unnecessary.
* <p/>
* <p>For robust session tracking, all URLs emitted by a servlet
* should be run through this
* method. Otherwise, URL rewriting cannot be used with browsers
* which do not support cookies.
*
* @param url the url to be encoded.
* @return the encoded URL if encoding is needed;
* the unchanged URL otherwise.
*/
String encodeURL(String url);
/**
* Encodes the specified URL for use in the
* <code>sendRedirect</code> method or, if encoding is not needed,
* returns the URL unchanged. The implementation of this method
* includes the logic to determine whether the session ID
* needs to be encoded in the URL. Because the rules for making
* this determination can differ from those used to decide whether to
* encode a normal link, this method is separated from the
* <code>encodeURL</code> method.
* <p/>
* <p>All URLs sent to the <code>HttpServletResponse.sendRedirect</code>
* method should be run through this method. Otherwise, URL
* rewriting cannot be used with browsers which do not support
* cookies.
*
* @param url the url to be encoded.
* @return the encoded URL if encoding is needed;
* the unchanged URL otherwise.
* @see #sendRedirect
* @see #encodeUrl
*/
String encodeRedirectURL(String url);
/**
* @param url the url to be encoded.
* @return the encoded URL if encoding is needed;
* the unchanged URL otherwise.
* @deprecated As of version 2.1, use encodeURL(String url) instead
*/
String encodeUrl(String url);
/**
* @param url the url to be encoded.
* @return the encoded URL if encoding is needed;
* the unchanged URL otherwise.
* @deprecated As of version 2.1, use
* encodeRedirectURL(String url) instead
*/
String encodeRedirectUrl(String url);
/**
* @param name header name
* @return header value
* @since 3.0
*/
String getHeader(String name);
/**
* @return all the header names
* @since 3.0
*/
Collection<String> getHeaderNames();
/**
* @param headerName header name for which headers are requested
* @return all the header values
* @since 3.0
*/
Collection<String> getHeaders(String headerName);
/**
* @return current http status
* @since 3.0
*/
int getStatus();
/**
* Sends an error response to the client using the specified status
* code and clearing the buffer.
* <p>If the response has already been committed, this method throws
* an IllegalStateException.
* After using this method, the response should be considered
* to be committed and should not be written to.
*
* @param sc the error status code
* @throws IOException If an input or output exception occurs
* @throws IllegalStateException If the response was committed
* before this method call
*/
void sendError(int sc) throws IOException;
/**
* Sends an error response to the client using the specified
* status. The server defaults to creating the
* response to look like an HTML-formatted server error page
* containing the specified message, setting the content type
* to "text/html", leaving cookies and other headers unmodified.
* <p/>
* If an error-page declaration has been made for the web application
* corresponding to the status code passed in, it will be served back in
* preference to the suggested msg parameter.
* <p/>
* <p>If the response has already been committed, this method throws
* an IllegalStateException.
* After using this method, the response should be considered
* to be committed and should not be written to.
*
* @param sc the error status code
* @param msg the descriptive message
* @throws IOException If an input or output exception occurs
* @throws IllegalStateException If the response was committed
*/
void sendError(int sc, String msg) throws IOException;
/**
* Sends a temporary redirect response to the client using the
* specified redirect location URL. This method can accept relative URLs;
* the servlet container must convert the relative URL to an absolute URL
* before sending the response to the client. If the location is relative
* without a leading '/' the container interprets it as relative to
* the current request URI. If the location is relative with a leading
* '/' the container interprets it as relative to the servlet container root.
* <p/>
* <p>If the response has already been committed, this method throws
* an IllegalStateException.
* After using this method, the response should be considered
* to be committed and should not be written to.
*
* @param location the redirect location URL
* @throws IOException If an input or output exception occurs
* @throws IllegalStateException If the response was committed or
* if a partial URL is given and cannot be converted into a valid URL
*/
void sendRedirect(String location) throws IOException;
/**
* Sets a response header with the given name and
* date-value. The date is specified in terms of
* milliseconds since the epoch. If the header had already
* been set, the new value overwrites the previous one. The
* <code>containsHeader</code> method can be used to test for the
* presence of a header before setting its value.
*
* @param name the name of the header to set
* @param date the assigned date value
* @see #containsHeader
* @see #addDateHeader
*/
void setDateHeader(String name, long date);
/**
* Sets a response header with the given name and value.
* If the header had already been set, the new value overwrites the
* previous one. The <code>containsHeader</code> method can be
* used to test for the presence of a header before setting its
* value.
*
* @param name the name of the header
* @param value the header value If it contains octet string,
* it should be encoded according to RFC 2047
* (http://www.ietf.org/rfc/rfc2047.txt)
* @see #containsHeader
* @see #addHeader
*/
void setHeader(String name, String value);
/**
* Sets a response header with the given name and
* integer value. If the header had already been set, the new value
* overwrites the previous one. The <code>containsHeader</code>
* method can be used to test for the presence of a header before
* setting its value.
*
* @param name the name of the header
* @param value the assigned integer value
* @see #containsHeader
* @see #addIntHeader
*/
void setIntHeader(String name, int value);
/**
* Sets the status code for this response. This method is used to
* set the return status code when there is no error (for example,
* for the status codes SC_OK or SC_MOVED_TEMPORARILY). If there
* is an error, and the caller wishes to invoke an error-page defined
* in the web application, the <code>sendError</code> method should be used
* instead.
* <p> The container clears the buffer and sets the Location header, preserving
* cookies and other headers.
*
* @param sc the status code
* @see #sendError
*/
void setStatus(int sc);
/**
* @param sc the status code
* @param sm the status message
* @deprecated As of version 2.1, due to ambiguous meaning of the
* message parameter. To set a status code
* use <code>setStatus(int)</code>, to send an error with a description
* use <code>sendError(int, String)</code>.
* <p/>
* Sets the status code and message for this response.
*/
void setStatus(int sc, String sm);
}
| 5 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpSessionActivationListener.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 javax.servlet.http;
import java.util.EventListener;
/**
* Objects that are bound to a session may listen to container
* events notifying them that sessions will be passivated and that
* session will be activated. A container that migrates session between VMs
* or persists sessions is required to notify all attributes bound to sessions
* implementing HttpSessionActivationListener.
*
* @version $Rev$ $Date$
* @since 2.3
*/
public interface HttpSessionActivationListener extends EventListener {
/**
* Notification that the session is about to be passivated.
*/
void sessionWillPassivate(HttpSessionEvent se);
/**
* Notification that the session has just been activated.
*/
void sessionDidActivate(HttpSessionEvent se);
}
| 6 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/Part.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 javax.servlet.http;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
/**
* multipart/form-data part or form item
*
* @version $Rev$ $Date$
* @since 3.0
*/
public interface Part {
void delete() throws IOException;
String getContentType();
String getHeader(String headerName);
Collection<String> getHeaderNames();
Collection<String> getHeaders(String headerName);
InputStream getInputStream() throws IOException;
String getName();
long getSize();
void write(String fileName) throws IOException;
}
| 7 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpSessionBindingListener.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 javax.servlet.http;
import java.util.EventListener;
/**
* Causes an object to be notified when it is bound to
* or unbound from a session. The object is notified
* by an {@link HttpSessionBindingEvent} object. This may be as a result
* of a servlet programmer explicitly unbinding an attribute from a session,
* due to a session being invalidated, or due to a session timing out.
*
* @version $Rev$ $Date$
* @see HttpSession
* @see HttpSessionBindingEvent
*/
public interface HttpSessionBindingListener extends EventListener {
/**
* Notifies the object that it is being bound to
* a session and identifies the session.
*
* @param event the event that identifies the
* session
* @see #valueUnbound
*/
void valueBound(HttpSessionBindingEvent event);
/**
* Notifies the object that it is being unbound
* from a session and identifies the session.
*
* @param event the event that identifies
* the session
* @see #valueBound
*/
void valueUnbound(HttpSessionBindingEvent event);
}
| 8 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpSessionAttributeListener.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 javax.servlet.http;
import java.util.EventListener;
/**
* This listener interface can be implemented in order to
* get notifications of changes to the attribute lists of sessions within
* this web application.
*
* @version $Rev$ $Date$
* @since v 2.3
*/
public interface HttpSessionAttributeListener extends EventListener {
/**
* Notification that an attribute has been added to a session. Called after the attribute is added.
*/
void attributeAdded(HttpSessionBindingEvent se);
/**
* Notification that an attribute has been removed from a session. Called after the attribute is removed.
*/
void attributeRemoved(HttpSessionBindingEvent se);
/**
* Notification that an attribute has been replaced in a session. Called after the attribute is replaced.
*/
void attributeReplaced(HttpSessionBindingEvent se);
}
| 9 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpSessionBindingEvent.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 javax.servlet.http;
/**
* Events of this type are either sent to an object that implements
* {@link HttpSessionBindingListener} when it is bound or
* unbound from a session, or to a {@link HttpSessionAttributeListener}
* that has been configured in the deployment descriptor when any attribute is
* bound, unbound or replaced in a session.
* <p/>
* <p>The session binds the object by a call to
* <code>HttpSession.setAttribute</code> and unbinds the object
* by a call to <code>HttpSession.removeAttribute</code>.
*
* @version $Rev$ $Date$
* @see HttpSessionAttributeListener
* @see HttpSession
* @see HttpSessionBindingListener
*/
public class HttpSessionBindingEvent extends HttpSessionEvent {
/* The name to which the object is being bound or unbound */
private final String name;
/* The object is being bound or unbound */
private final Object value;
/**
* Constructs an event that notifies an object that it
* has been bound to or unbound from a session.
* To receive the event, the object must implement
* {@link HttpSessionBindingListener}.
*
* @param session the session to which the object is bound or unbound
* @param name the name with which the object is bound or unbound
* @see #getName
* @see #getSession
*/
public HttpSessionBindingEvent(HttpSession session, String name) {
super(session);
this.name = name;
value = null;
}
/**
* Constructs an event that notifies an object that it
* has been bound to or unbound from a session.
* To receive the event, the object must implement
* {@link HttpSessionBindingListener}.
*
* @param session the session to which the object is bound or unbound
* @param name the name with which the object is bound or unbound
* @see #getName
* @see #getSession
*/
public HttpSessionBindingEvent(HttpSession session, String name, Object value) {
super(session);
this.name = name;
this.value = value;
}
/**
* Return the session that changed.
*/
public HttpSession getSession() {
return super.getSession();
}
/**
* Returns the name with which the attribute is bound to or
* unbound from the session.
*
* @return a string specifying the name with which
* the object is bound to or unbound from
* the session
*/
public String getName() {
return name;
}
/**
* Returns the value of the attribute that has been added, removed or replaced.
* If the attribute was added (or bound), this is the value of the attribute. If the attribute was
* removed (or unbound), this is the value of the removed attribute. If the attribute was replaced, this
* is the old value of the attribute.
*
* @since 2.3
*/
public Object getValue() {
return this.value;
}
}
| 10 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpSession.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 javax.servlet.http;
import java.util.Enumeration;
import javax.servlet.ServletContext;
/**
* Provides a way to identify a user across more than one page
* request or visit to a Web site and to store information about that user.
* <p/>
* <p>The servlet container uses this interface to create a session
* between an HTTP client and an HTTP server. The session persists
* for a specified time period, across more than one connection or
* page request from the user. A session usually corresponds to one
* user, who may visit a site many times. The server can maintain a
* session in many ways such as using cookies or rewriting URLs.
* <p/>
* <p>This interface allows servlets to
* <ul>
* <li>View and manipulate information about a session, such as
* the session identifier, creation time, and last accessed time
* <li>Bind objects to sessions, allowing user information to persist
* across multiple user connections
* </ul>
* <p/>
* <p>When an application stores an object in or removes an object from a
* session, the session checks whether the object implements
* {@link HttpSessionBindingListener}. If it does,
* the servlet notifies the object that it has been bound to or unbound
* from the session. Notifications are sent after the binding methods complete.
* For session that are invalidated or expire, notifications are sent after
* the session has been invalidated or expired.
* <p/>
* <p> When container migrates a session between VMs in a distributed container
* setting, all session attributes implementing the {@link HttpSessionActivationListener}
* interface are notified.
* <p/>
* <p>A servlet should be able to handle cases in which
* the client does not choose to join a session, such as when cookies are
* intentionally turned off. Until the client joins the session,
* <code>isNew</code> returns <code>true</code>. If the client chooses
* not to join
* the session, <code>getSession</code> will return a different session
* on each request, and <code>isNew</code> will always return
* <code>true</code>.
* <p/>
* <p>Session information is scoped only to the current web application
* (<code>ServletContext</code>), so information stored in one context
* will not be directly visible in another.
*
* @version $Rev$ $Date$
* @see HttpSessionBindingListener
* @see HttpSessionContext
*/
public interface HttpSession {
/**
* Returns the time when this session was created, measured
* in milliseconds since midnight January 1, 1970 GMT.
*
* @throws IllegalStateException if this method is called on an
* invalidated session
* @return a <code>long</code> specifying
* when this session was created,
* expressed in
* milliseconds since 1/1/1970 GMT
*/
long getCreationTime();
/**
* Returns a string containing the unique identifier assigned
* to this session. The identifier is assigned
* by the servlet container and is implementation dependent.
*
* @throws IllegalStateException if this method is called on an
* invalidated session
* @return a string specifying the identifier
* assigned to this session
*/
String getId();
/**
* Returns the last time the client sent a request associated with
* this session, as the number of milliseconds since midnight
* January 1, 1970 GMT, and marked by the time the container received the request.
* <p/>
* <p>Actions that your application takes, such as getting or setting
* a value associated with the session, do not affect the access
* time.
*
* @throws IllegalStateException if this method is called on an
* invalidated session
* @return a <code>long</code>
* representing the last time
* the client sent a request associated
* with this session, expressed in
* milliseconds since 1/1/1970 GMT
*/
long getLastAccessedTime();
/**
* Returns the ServletContext to which this session belongs.
*
* @return The ServletContext object for the web application
* @since 2.3
*/
ServletContext getServletContext();
/**
* Specifies the time, in seconds, between client requests before the
* servlet container will invalidate this session. A negative time
* indicates the session should never timeout.
*
* @param interval An integer specifying the number
* of seconds
*/
void setMaxInactiveInterval(int interval);
/**
* Returns the maximum time interval, in seconds, that
* the servlet container will keep this session open between
* client accesses. After this interval, the servlet container
* will invalidate the session. The maximum time interval can be set
* with the <code>setMaxInactiveInterval</code> method.
* A negative time indicates the session should never timeout.
*
* @return an integer specifying the number of
* seconds this session remains open
* between client requests
* @see #setMaxInactiveInterval
*/
int getMaxInactiveInterval();
/**
* @deprecated As of Version 2.1, this method is
* deprecated and has no replacement.
* It will be removed in a future
* version of the Java Servlet API.
*/
HttpSessionContext getSessionContext();
/**
* Returns the object bound with the specified name in this session, or
* <code>null</code> if no object is bound under the name.
*
* @param name a string specifying the name of the object
* @throws IllegalStateException if this method is called on an
* invalidated session
* @return the object with the specified name
*/
Object getAttribute(String name);
/**
* @param name a string specifying the name of the object
* @throws IllegalStateException if this method is called on an
* invalidated session
* @return the object with the specified name
* @deprecated As of Version 2.2, this method is
* replaced by {@link #getAttribute}.
*/
Object getValue(String name);
/**
* Returns an <code>Enumeration</code> of <code>String</code> objects
* containing the names of all the objects bound to this session.
*
* @throws IllegalStateException if this method is called on an
* invalidated session
* @return an <code>Enumeration</code> of
* <code>String</code> objects specifying the
* names of all the objects bound to
* this session
*/
Enumeration<String> getAttributeNames();
/**
* @throws IllegalStateException if this method is called on an
* invalidated session
* @return an array of <code>String</code>
* objects specifying the
* names of all the objects bound to
* this session
* @deprecated As of Version 2.2, this method is
* replaced by {@link #getAttributeNames}
*/
String[] getValueNames();
/**
* Binds an object to this session, using the name specified.
* If an object of the same name is already bound to the session,
* the object is replaced.
* <p/>
* <p>After this method executes, and if the new object
* implements <code>HttpSessionBindingListener</code>,
* the container calls
* <code>HttpSessionBindingListener.valueBound</code>. The container then
* notifies any <code>HttpSessionAttributeListener</code>s in the web
* application.
* <p/>
* <p>If an object was already bound to this session of this name
* that implements <code>HttpSessionBindingListener</code>, its
* <code>HttpSessionBindingListener.valueUnbound</code> method is called.
* <p/>
* <p>If the value passed in is null, this has the same effect as calling
* <code>removeAttribute()<code>.
*
* @param name the name to which the object is bound;
* cannot be null
* @param value the object to be bound
* @throws IllegalStateException if this method is called on an
* invalidated session
*/
void setAttribute(String name, Object value);
/**
* @param name the name to which the object is bound;
* cannot be null
* @param value the object to be bound; cannot be null
* @throws IllegalStateException if this method is called on an
* invalidated session
* @deprecated As of Version 2.2, this method is
* replaced by {@link #setAttribute}
*/
void putValue(String name, Object value);
/**
* Removes the object bound with the specified name from
* this session. If the session does not have an object
* bound with the specified name, this method does nothing.
* <p/>
* <p>After this method executes, and if the object
* implements <code>HttpSessionBindingListener</code>,
* the container calls
* <code>HttpSessionBindingListener.valueUnbound</code>. The container
* then notifies any <code>HttpSessionAttributeListener</code>s in the web
* application.
*
* @param name the name of the object to
* remove from this session
* @throws IllegalStateException if this method is called on an
* invalidated session
*/
void removeAttribute(String name);
/**
* @param name the name of the object to
* remove from this session
* @throws IllegalStateException if this method is called on an
* invalidated session
* @deprecated As of Version 2.2, this method is
* replaced by {@link #removeAttribute}
*/
void removeValue(String name);
/**
* Invalidates this session then unbinds any objects bound
* to it.
*
* @throws IllegalStateException if this method is called on an
* already invalidated session
*/
void invalidate();
/**
* Returns <code>true</code> if the client does not yet know about the
* session or if the client chooses not to join the session. For
* example, if the server used only cookie-based sessions, and
* the client had disabled the use of cookies, then a session would
* be new on each request.
*
* @return <code>true</code> if the
* server has created a session,
* but the client has not yet joined
* @throws IllegalStateException if this method is called on an
* already invalidated session
*/
boolean isNew();
}
| 11 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpSessionEvent.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 javax.servlet.http;
/**
* This is the class representing event notifications for
* changes to sessions within a web application.
*
* @version $Rev$ $Date$
* @since v 2.3
*/
public class HttpSessionEvent extends java.util.EventObject {
/**
* Construct a session event from the given source.
*/
public HttpSessionEvent(HttpSession source) {
super(source);
}
/**
* Return the session that changed.
*/
public HttpSession getSession() {
return (HttpSession) super.getSource();
}
}
| 12 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/Cookie.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 javax.servlet.http;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ResourceBundle;
/**
* Creates a cookie, a small amount of information sent by a servlet to
* a Web browser, saved by the browser, and later sent back to the server.
* A cookie's value can uniquely
* identify a client, so cookies are commonly used for session management.
* <p/>
* <p>A cookie has a name, a single value, and optional attributes
* such as a comment, path and domain qualifiers, a maximum age, and a
* version number. Some Web browsers have bugs in how they handle the
* optional attributes, so use them sparingly to improve the interoperability
* of your servlets.
* <p/>
* <p>The servlet sends cookies to the browser by using the
* {@link HttpServletResponse#addCookie} method, which adds
* fields to HTTP response headers to send cookies to the
* browser, one at a time. The browser is expected to
* support 20 cookies for each Web server, 300 cookies total, and
* may limit cookie size to 4 KB each.
* <p/>
* <p>The browser returns cookies to the servlet by adding
* fields to HTTP request headers. Cookies can be retrieved
* from a request by using the {@link HttpServletRequest#getCookies} method.
* Several cookies might have the same name but different path attributes.
* <p/>
* <p>Cookies affect the caching of the Web pages that use them.
* HTTP 1.0 does not cache pages that use cookies created with
* this class. This class does not support the cache control
* defined with HTTP 1.1.
* <p/>
* <p>This class supports both the Version 0 (by Netscape) and Version 1
* (by RFC 2109) cookie specifications. By default, cookies are
* created using Version 0 to ensure the best interoperability.
*
* @version $Rev$ $Date$
*/
public class Cookie implements Cloneable, Serializable {
private static final long serialVersionUID = -6454587001725327448L;
private static final String LSTRING_FILE =
"javax.servlet.http.LocalStrings";
private static ResourceBundle lStrings =
ResourceBundle.getBundle(LSTRING_FILE);
// Note -- disabled for now to allow full Netscape compatibility
// from RFC 2068, token special case characters
//
// private static final String tspecials = "()<>@,;:\\\"/[]?={} \t";
private static final String tspecials = ",; ";
//
// The value of the cookie itself.
//
private String name; // NAME= ... "$Name" style is reserved
private String value; // value of NAME
//
// Attributes encoded in the header's cookie fields.
//
private String comment; // ;Comment=VALUE ... describes cookie's use
// ;Discard ... implied by maxAge < 0
private String domain; // ;Domain=VALUE ... domain that sees cookie
private int maxAge = -1; // ;Max-Age=VALUE ... cookies auto-expire
private String path; // ;Path=VALUE ... URLs that see the cookie
private boolean secure; // ;Secure ... e.g. use SSL
private int version = 0; // ;Version=1 ... means RFC 2109++ style
private boolean httpOnly;
/**
* Constructs a cookie with a specified name and value.
* <p/>
* <p>The name must conform to RFC 2109. That means it can contain
* only ASCII alphanumeric characters and cannot contain commas,
* semicolons, or white space or begin with a $ character. The cookie's
* name cannot be changed after creation.
* <p/>
* <p>The value can be anything the server chooses to send. Its
* value is probably of interest only to the server. The cookie's
* value can be changed after creation with the
* <code>setValue</code> method.
* <p/>
* <p>By default, cookies are created according to the Netscape
* cookie specification. The version can be changed with the
* <code>setVersion</code> method.
*
* @param name a <code>String</code> specifying the name of the cookie
* @param value a <code>String</code> specifying the value of the cookie
* @throws IllegalArgumentException if the cookie name contains illegal characters
* (for example, a comma, space, or semicolon)
* or it is one of the tokens reserved for use
* by the cookie protocol
* @see #setValue
* @see #setVersion
*/
public Cookie(String name, String value) {
if (!isToken(name)
|| name.equalsIgnoreCase("Comment") // rfc2019
|| name.equalsIgnoreCase("Discard") // 2019++
|| name.equalsIgnoreCase("Domain")
|| name.equalsIgnoreCase("Expires") // (old cookies)
|| name.equalsIgnoreCase("Max-Age") // rfc2019
|| name.equalsIgnoreCase("Path")
|| name.equalsIgnoreCase("Secure")
|| name.equalsIgnoreCase("Version")
|| name.startsWith("$")
) {
String errMsg = lStrings.getString("err.cookie_name_is_token");
Object[] errArgs = new Object[1];
errArgs[0] = name;
errMsg = MessageFormat.format(errMsg, errArgs);
throw new IllegalArgumentException(errMsg);
}
this.name = name;
this.value = value;
}
/**
* Specifies a comment that describes a cookie's purpose.
* The comment is useful if the browser presents the cookie
* to the user. Comments
* are not supported by Netscape Version 0 cookies.
*
* @param purpose a <code>String</code> specifying the comment
* to display to the user
* @see #getComment
*/
public void setComment(String purpose) {
comment = purpose;
}
/**
* Returns the comment describing the purpose of this cookie, or
* <code>null</code> if the cookie has no comment.
*
* @return a <code>String</code> containing the comment,
* or <code>null</code> if none
* @see #setComment
*/
public String getComment() {
return comment;
}
/**
* Specifies the domain within which this cookie should be presented.
* <p/>
* <p>The form of the domain name is specified by RFC 2109. A domain
* name begins with a dot (<code>.foo.com</code>) and means that
* the cookie is visible to servers in a specified Domain Name System
* (DNS) zone (for example, <code>www.foo.com</code>, but not
* <code>a.b.foo.com</code>). By default, cookies are only returned
* to the server that sent them.
*
* @param pattern a <code>String</code> containing the domain name
* within which this cookie is visible;
* form is according to RFC 2109
* @see #getDomain
*/
public void setDomain(String pattern) {
domain = pattern.toLowerCase(); // IE allegedly needs this
}
/**
* Returns the domain name set for this cookie. The form of
* the domain name is set by RFC 2109.
*
* @return a <code>String</code> containing the domain name
* @see #setDomain
*/
public String getDomain() {
return domain;
}
/**
* Sets the maximum age of the cookie in seconds.
* <p/>
* <p>A positive value indicates that the cookie will expire
* after that many seconds have passed. Note that the value is
* the <i>maximum</i> age when the cookie will expire, not the cookie's
* current age.
* <p/>
* <p>A negative value means
* that the cookie is not stored persistently and will be deleted
* when the Web browser exits. A zero value causes the cookie
* to be deleted.
*
* @param expiry an integer specifying the maximum age of the
* cookie in seconds; if negative, means
* the cookie is not stored; if zero, deletes
* the cookie
* @see #getMaxAge
*/
public void setMaxAge(int expiry) {
maxAge = expiry;
}
/**
* Returns the maximum age of the cookie, specified in seconds,
* By default, <code>-1</code> indicating the cookie will persist
* until browser shutdown.
*
* @return an integer specifying the maximum age of the
* cookie in seconds; if negative, means
* the cookie persists until browser shutdown
* @see #setMaxAge
*/
public int getMaxAge() {
return maxAge;
}
/**
* Specifies a path for the cookie
* to which the client should return the cookie.
* <p/>
* <p>The cookie is visible to all the pages in the directory
* you specify, and all the pages in that directory's subdirectories.
* A cookie's path must include the servlet that set the cookie,
* for example, <i>/catalog</i>, which makes the cookie
* visible to all directories on the server under <i>/catalog</i>.
* <p/>
* <p>Consult RFC 2109 (available on the Internet) for more
* information on setting path names for cookies.
*
* @param uri a <code>String</code> specifying a path
* @see #getPath
*/
public void setPath(String uri) {
path = uri;
}
/**
* Returns the path on the server
* to which the browser returns this cookie. The
* cookie is visible to all subpaths on the server.
*
* @return a <code>String</code> specifying a path that contains
* a servlet name, for example, <i>/catalog</i>
* @see #setPath
*/
public String getPath() {
return path;
}
/**
* Indicates to the browser whether the cookie should only be sent
* using a secure protocol, such as HTTPS or SSL.
* <p/>
* <p>The default value is <code>false</code>.
*
* @param flag if <code>true</code>, sends the cookie from the browser
* to the server only when using a secure protocol;
* if <code>false</code>, sent on any protocol
* @see #getSecure
*/
public void setSecure(boolean flag) {
secure = flag;
}
/**
* Returns <code>true</code> if the browser is sending cookies
* only over a secure protocol, or <code>false</code> if the
* browser can send cookies using any protocol.
*
* @return <code>true</code> if the browser uses a secure protocol;
* otherwise, <code>true</code>
* @see #setSecure
*/
public boolean getSecure() {
return secure;
}
/**
* Returns the name of the cookie. The name cannot be changed after
* creation.
*
* @return a <code>String</code> specifying the cookie's name
*/
public String getName() {
return name;
}
/**
* Assigns a new value to a cookie after the cookie is created.
* If you use a binary value, you may want to use BASE64 encoding.
* <p/>
* <p>With Version 0 cookies, values should not contain white
* space, brackets, parentheses, equals signs, commas,
* double quotes, slashes, question marks, at signs, colons,
* and semicolons. Empty values may not behave the same way
* on all browsers.
*
* @param newValue a <code>String</code> specifying the new value
* @see #getValue
* @see Cookie
*/
public void setValue(String newValue) {
value = newValue;
}
/**
* Returns the value of the cookie.
*
* @return a <code>String</code> containing the cookie's
* present value
* @see #setValue
* @see Cookie
*/
public String getValue() {
return value;
}
/**
* Returns the version of the protocol this cookie complies
* with. Version 1 complies with RFC 2109,
* and version 0 complies with the original
* cookie specification drafted by Netscape. Cookies provided
* by a browser use and identify the browser's cookie version.
*
* @return 0 if the cookie complies with the
* original Netscape specification; 1
* if the cookie complies with RFC 2109
* @see #setVersion
*/
public int getVersion() {
return version;
}
/**
* Sets the version of the cookie protocol this cookie complies
* with. Version 0 complies with the original Netscape cookie
* specification. Version 1 complies with RFC 2109.
* <p/>
* <p>Since RFC 2109 is still somewhat new, consider
* version 1 as experimental; do not use it yet on production sites.
*
* @param v 0 if the cookie should comply with
* the original Netscape specification;
* 1 if the cookie should comply with RFC 2109
* @see #getVersion
*/
public void setVersion(int v) {
version = v;
}
/*
* Tests a string and returns true if the string counts as a
* reserved token in the Java language.
*
* @param value the <code>String</code> to be tested
*
* @return <code>true</code> if the <code>String</code> is
* a reserved token; <code>false</code>
* if it is not
*/
private boolean isToken(String value) {
int len = value.length();
for (int i = 0; i < len; i++) {
char c = value.charAt(i);
if (c < 0x20 || c >= 0x7f || tspecials.indexOf(c) != -1)
return false;
}
return true;
}
/**
* Overrides the standard <code>java.lang.Object.clone</code>
* method to return a copy of this cookie.
*/
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e.getMessage());
}
}
/**
* @return whether cookie is http only
* @since servlet 3.0
*/
public boolean isHttpOnly() {
return httpOnly;
}
/**
* @param httpOnly httpOnly setting
* @since servlet 3.0
*/
public void setHttpOnly(boolean httpOnly) {
this.httpOnly = httpOnly;
}
}
| 13 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpServletRequestWrapper.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 javax.servlet.http;
import javax.servlet.ServletRequestWrapper;
import javax.servlet.ServletException;
import java.util.Enumeration;
import java.util.Collection;
import java.io.IOException;
/**
* Provides a convenient implementation of the HttpServletRequest interface that
* can be subclassed by developers wishing to adapt the request to a Servlet.
* This class implements the Wrapper or Decorator pattern. Methods default to
* calling through to the wrapped request object.
*
* @version $Rev$ $Date$
* @since v 2.3
* @see javax.servlet.http.HttpServletRequest
*/
public class HttpServletRequestWrapper extends ServletRequestWrapper implements HttpServletRequest {
/**
* Constructs a request object wrapping the given request.
*
* @param request request to wrap
* @throws java.lang.IllegalArgumentException
* if the request is null
*/
public HttpServletRequestWrapper(HttpServletRequest request) {
super(request);
}
private HttpServletRequest getHttpServletRequest() {
return (HttpServletRequest) super.getRequest();
}
public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
return getHttpServletRequest().authenticate(response);
}
/**
* The default behavior of this method is to return getAuthType()
* on the wrapped request object.
*/
public String getAuthType() {
return getHttpServletRequest().getAuthType();
}
/**
* The default behavior of this method is to return getCookies()
* on the wrapped request object.
*/
public Cookie[] getCookies() {
return getHttpServletRequest().getCookies();
}
/**
* The default behavior of this method is to return getDateHeader(String name)
* on the wrapped request object.
*/
public long getDateHeader(String name) {
return getHttpServletRequest().getDateHeader(name);
}
/**
* The default behavior of this method is to return getHeader(String name)
* on the wrapped request object.
*/
public String getHeader(String name) {
return getHttpServletRequest().getHeader(name);
}
/**
* The default behavior of this method is to return getHeaders(String name)
* on the wrapped request object.
*/
public Enumeration<String> getHeaders(String name) {
return getHttpServletRequest().getHeaders(name);
}
/**
* The default behavior of this method is to return getHeaderNames()
* on the wrapped request object.
*/
public Enumeration<String> getHeaderNames() {
return getHttpServletRequest().getHeaderNames();
}
/**
* The default behavior of this method is to return getIntHeader(String name)
* on the wrapped request object.
*/
public int getIntHeader(String name) {
return getHttpServletRequest().getIntHeader(name);
}
/**
* The default behavior of this method is to return getMethod()
* on the wrapped request object.
*/
public String getMethod() {
return getHttpServletRequest().getMethod();
}
public Part getPart(String name) throws IOException, ServletException {
return getHttpServletRequest().getPart(name);
}
public Collection<Part> getParts() throws IOException, ServletException {
return getHttpServletRequest().getParts();
}
/**
* The default behavior of this method is to return getPathInfo()
* on the wrapped request object.
*/
public String getPathInfo() {
return getHttpServletRequest().getPathInfo();
}
/**
* The default behavior of this method is to return getPathTranslated()
* on the wrapped request object.
*/
public String getPathTranslated() {
return getHttpServletRequest().getPathTranslated();
}
/**
* The default behavior of this method is to return getContextPath()
* on the wrapped request object.
*/
public String getContextPath() {
return getHttpServletRequest().getContextPath();
}
/**
* The default behavior of this method is to return getQueryString()
* on the wrapped request object.
*/
public String getQueryString() {
return getHttpServletRequest().getQueryString();
}
/**
* The default behavior of this method is to return getRemoteUser()
* on the wrapped request object.
*/
public String getRemoteUser() {
return getHttpServletRequest().getRemoteUser();
}
/**
* The default behavior of this method is to return isUserInRole(String role)
* on the wrapped request object.
*/
public boolean isUserInRole(String role) {
return getHttpServletRequest().isUserInRole(role);
}
public void login(String username, String password) throws ServletException {
getHttpServletRequest().login(username, password);
}
public void logout() throws ServletException {
getHttpServletRequest().logout();
}
/**
* The default behavior of this method is to return getUserPrincipal()
* on the wrapped request object.
*/
public java.security.Principal getUserPrincipal() {
return getHttpServletRequest().getUserPrincipal();
}
/**
* The default behavior of this method is to return getRequestedSessionId()
* on the wrapped request object.
*/
public String getRequestedSessionId() {
return getHttpServletRequest().getRequestedSessionId();
}
/**
* The default behavior of this method is to return getRequestURI()
* on the wrapped request object.
*/
public String getRequestURI() {
return getHttpServletRequest().getRequestURI();
}
/**
* The default behavior of this method is to return getRequestURL()
* on the wrapped request object.
*/
public StringBuffer getRequestURL() {
return getHttpServletRequest().getRequestURL();
}
/**
* The default behavior of this method is to return getServletPath()
* on the wrapped request object.
*/
public String getServletPath() {
return getHttpServletRequest().getServletPath();
}
/**
* The default behavior of this method is to return getSession(boolean create)
* on the wrapped request object.
*/
public HttpSession getSession(boolean create) {
return getHttpServletRequest().getSession(create);
}
/**
* The default behavior of this method is to return getSession()
* on the wrapped request object.
*/
public HttpSession getSession() {
return getHttpServletRequest().getSession();
}
/**
* The default behavior of this method is to return isRequestedSessionIdValid()
* on the wrapped request object.
*/
public boolean isRequestedSessionIdValid() {
return getHttpServletRequest().isRequestedSessionIdValid();
}
/**
* The default behavior of this method is to return isRequestedSessionIdFromCookie()
* on the wrapped request object.
*/
public boolean isRequestedSessionIdFromCookie() {
return getHttpServletRequest().isRequestedSessionIdFromCookie();
}
/**
* The default behavior of this method is to return isRequestedSessionIdFromURL()
* on the wrapped request object.
*/
public boolean isRequestedSessionIdFromURL() {
return getHttpServletRequest().isRequestedSessionIdFromURL();
}
/**
* The default behavior of this method is to return isRequestedSessionIdFromUrl()
* on the wrapped request object.
*/
public boolean isRequestedSessionIdFromUrl() {
return getHttpServletRequest().isRequestedSessionIdFromUrl();
}
}
| 14 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpSessionListener.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 javax.servlet.http;
import java.util.EventListener;
/**
* Implementations of this interface are notified of changes to the
* list of active sessions in a web application.
* To receive notification events, the implementation class
* must be configured in the deployment descriptor for the web application.
*
* @version $Rev$ $Date$
* @see HttpSessionEvent
* @since v 2.3
*/
public interface HttpSessionListener extends EventListener {
/**
* Notification that a session was created.
*
* @param se the notification event
*/
void sessionCreated(HttpSessionEvent se);
/**
* Notification that a session is about to be invalidated.
*
* @param se the notification event
*/
void sessionDestroyed(HttpSessionEvent se);
}
| 15 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpServlet.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 javax.servlet.http;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.Enumeration;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
/**
* Provides an abstract class to be subclassed to create
* an HTTP servlet suitable for a Web site. A subclass of
* <code>HttpServlet</code> must override at least
* one method, usually one of these:
* <p/>
* <ul>
* <li> <code>doGet</code>, if the servlet supports HTTP GET requests
* <li> <code>doPost</code>, for HTTP POST requests
* <li> <code>doPut</code>, for HTTP PUT requests
* <li> <code>doDelete</code>, for HTTP DELETE requests
* <li> <code>init</code> and <code>destroy</code>,
* to manage resources that are held for the life of the servlet
* <li> <code>getServletInfo</code>, which the servlet uses to
* provide information about itself
* </ul>
* <p/>
* <p>There's almost no reason to override the <code>service</code>
* method. <code>service</code> handles standard HTTP
* requests by dispatching them to the handler methods
* for each HTTP request type (the <code>do</code><i>XXX</i>
* methods listed above).
* <p/>
* <p>Likewise, there's almost no reason to override the
* <code>doOptions</code> and <code>doTrace</code> methods.
* <p/>
* <p>Servlets typically run on multithreaded servers,
* so be aware that a servlet must handle concurrent
* requests and be careful to synchronize access to shared resources.
* Shared resources include in-memory data such as
* instance or class variables and external objects
* such as files, database connections, and network
* connections.
* See the
* <a href="http://java.sun.com/Series/Tutorial/java/threads/multithreaded.html">
* Java Tutorial on Multithreaded Programming</a> for more
* information on handling multiple threads in a Java program.
*
* @version $Rev$ $Date$
*/
public abstract class HttpServlet extends GenericServlet
implements java.io.Serializable {
private static final String METHOD_DELETE = "DELETE";
private static final String METHOD_HEAD = "HEAD";
private static final String METHOD_GET = "GET";
private static final String METHOD_OPTIONS = "OPTIONS";
private static final String METHOD_POST = "POST";
private static final String METHOD_PUT = "PUT";
private static final String METHOD_TRACE = "TRACE";
private static final String HEADER_IFMODSINCE = "If-Modified-Since";
private static final String HEADER_LASTMOD = "Last-Modified";
private static final String LSTRING_FILE =
"javax.servlet.http.LocalStrings";
private static ResourceBundle lStrings =
ResourceBundle.getBundle(LSTRING_FILE);
/**
* Does nothing, because this is an abstract class.
*/
public HttpServlet() {
}
/**
* Called by the server (via the <code>service</code> method) to
* allow a servlet to handle a GET request.
* <p/>
* <p>Overriding this method to support a GET request also
* automatically supports an HTTP HEAD request. A HEAD
* request is a GET request that returns no body in the
* response, only the request header fields.
* <p/>
* <p>When overriding this method, read the request data,
* write the response headers, get the response's writer or
* output stream object, and finally, write the response data.
* It's best to include content type and encoding. When using
* a <code>PrintWriter</code> object to return the response,
* set the content type before accessing the
* <code>PrintWriter</code> object.
* <p/>
* <p>The servlet container must write the headers before
* committing the response, because in HTTP the headers must be sent
* before the response body.
* <p/>
* <p>Where possible, set the Content-Length header (with the
* {@link javax.servlet.ServletResponse#setContentLength} method),
* to allow the servlet container to use a persistent connection
* to return its response to the client, improving performance.
* The content length is automatically set if the entire response fits
* inside the response buffer.
* <p/>
* <p>When using HTTP 1.1 chunked encoding (which means that the response
* has a Transfer-Encoding header), do not set the Content-Length header.
* <p/>
* <p>The GET method should be safe, that is, without
* any side effects for which users are held responsible.
* For example, most form queries have no side effects.
* If a client request is intended to change stored data,
* the request should use some other HTTP method.
* <p/>
* <p>The GET method should also be idempotent, meaning
* that it can be safely repeated. Sometimes making a
* method safe also makes it idempotent. For example,
* repeating queries is both safe and idempotent, but
* buying a product online or modifying data is neither
* safe nor idempotent.
* <p/>
* <p>If the request is incorrectly formatted, <code>doGet</code>
* returns an HTTP "Bad Request" message.
*
* @param req an {@link HttpServletRequest} object that
* contains the request the client has made
* of the servlet
* @param resp an {@link HttpServletResponse} object that
* contains the response the servlet sends
* to the client
* @throws IOException if an input or output error is
* detected when the servlet handles
* the GET request
* @throws ServletException if the request for the GET
* could not be handled
* @see javax.servlet.ServletResponse#setContentType
*/
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String protocol = req.getProtocol();
String msg = lStrings.getString("http.method_get_not_supported");
if (protocol.endsWith("1.1")) {
resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
} else {
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
}
}
/**
* Returns the time the <code>HttpServletRequest</code>
* object was last modified,
* in milliseconds since midnight January 1, 1970 GMT.
* If the time is unknown, this method returns a negative
* number (the default).
* <p/>
* <p>Servlets that support HTTP GET requests and can quickly determine
* their last modification time should override this method.
* This makes browser and proxy caches work more effectively,
* reducing the load on server and network resources.
*
* @param req the <code>HttpServletRequest</code>
* object that is sent to the servlet
* @return a <code>long</code> integer specifying
* the time the <code>HttpServletRequest</code>
* object was last modified, in milliseconds
* since midnight, January 1, 1970 GMT, or
* -1 if the time is not known
*/
protected long getLastModified(HttpServletRequest req) {
return -1;
}
/**
* <p>Receives an HTTP HEAD request from the protected
* <code>service</code> method and handles the
* request.
* The client sends a HEAD request when it wants
* to see only the headers of a response, such as
* Content-Type or Content-Length. The HTTP HEAD
* method counts the output bytes in the response
* to set the Content-Length header accurately.
* <p/>
* <p>If you override this method, you can avoid computing
* the response body and just set the response headers
* directly to improve performance. Make sure that the
* <code>doHead</code> method you write is both safe
* and idempotent (that is, protects itself from being
* called multiple times for one HTTP HEAD request).
* <p/>
* <p>If the HTTP HEAD request is incorrectly formatted,
* <code>doHead</code> returns an HTTP "Bad Request"
* message.
*
* @param req the request object that is passed
* to the servlet
* @param resp the response object that the servlet
* uses to return the headers to the clien
* @throws IOException if an input or output error occurs
* @throws ServletException if the request for the HEAD
* could not be handled
*/
protected void doHead(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
NoBodyResponse response = new NoBodyResponse(resp);
doGet(req, response);
response.setContentLength();
}
/**
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a POST request.
* <p/>
* The HTTP POST method allows the client to send
* data of unlimited length to the Web server a single time
* and is useful when posting information such as
* credit card numbers.
* <p/>
* <p>When overriding this method, read the request data,
* write the response headers, get the response's writer or output
* stream object, and finally, write the response data. It's best
* to include content type and encoding. When using a
* <code>PrintWriter</code> object to return the response, set the
* content type before accessing the <code>PrintWriter</code> object.
* <p/>
* <p>The servlet container must write the headers before committing the
* response, because in HTTP the headers must be sent before the
* response body.
* <p/>
* <p>Where possible, set the Content-Length header (with the
* {@link javax.servlet.ServletResponse#setContentLength} method),
* to allow the servlet container to use a persistent connection
* to return its response to the client, improving performance.
* The content length is automatically set if the entire response fits
* inside the response buffer.
* <p/>
* <p>When using HTTP 1.1 chunked encoding (which means that the response
* has a Transfer-Encoding header), do not set the Content-Length header.
* <p/>
* <p>This method does not need to be either safe or idempotent.
* Operations requested through POST can have side effects for
* which the user can be held accountable, for example,
* updating stored data or buying items online.
* <p/>
* <p>If the HTTP POST request is incorrectly formatted,
* <code>doPost</code> returns an HTTP "Bad Request" message.
*
* @param req an {@link HttpServletRequest} object that
* contains the request the client has made
* of the servlet
* @param resp an {@link HttpServletResponse} object that
* contains the response the servlet sends
* to the client
* @throws IOException if an input or output error is
* detected when the servlet handles
* the request
* @throws ServletException if the request for the POST
* could not be handled
* @see javax.servlet.ServletOutputStream
* @see javax.servlet.ServletResponse#setContentType
*/
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String protocol = req.getProtocol();
String msg = lStrings.getString("http.method_post_not_supported");
if (protocol.endsWith("1.1")) {
resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
} else {
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
}
}
/**
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a PUT request.
* <p/>
* The PUT operation allows a client to
* place a file on the server and is similar to
* sending a file by FTP.
* <p/>
* <p>When overriding this method, leave intact
* any content headers sent with the request (including
* Content-Length, Content-Type, Content-Transfer-Encoding,
* Content-Encoding, Content-Base, Content-Language, Content-Location,
* Content-MD5, and Content-Range). If your method cannot
* handle a content header, it must issue an error message
* (HTTP 501 - Not Implemented) and discard the request.
* For more information on HTTP 1.1, see RFC 2616
* <a href="http://www.ietf.org/rfc/rfc2616.txt"></a>.
* <p/>
* <p>This method does not need to be either safe or idempotent.
* Operations that <code>doPut</code> performs can have side
* effects for which the user can be held accountable. When using
* this method, it may be useful to save a copy of the
* affected URL in temporary storage.
* <p/>
* <p>If the HTTP PUT request is incorrectly formatted,
* <code>doPut</code> returns an HTTP "Bad Request" message.
*
* @param req the {@link HttpServletRequest} object that
* contains the request the client made of
* the servlet
* @param resp the {@link HttpServletResponse} object that
* contains the response the servlet returns
* to the client
* @throws IOException if an input or output error occurs
* while the servlet is handling the
* PUT request
* @throws ServletException if the request for the PUT
* cannot be handled
*/
protected void doPut(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String protocol = req.getProtocol();
String msg = lStrings.getString("http.method_put_not_supported");
if (protocol.endsWith("1.1")) {
resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
} else {
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
}
}
/**
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a DELETE request.
* <p/>
* The DELETE operation allows a client to remove a document
* or Web page from the server.
* <p/>
* <p>This method does not need to be either safe
* or idempotent. Operations requested through
* DELETE can have side effects for which users
* can be held accountable. When using
* this method, it may be useful to save a copy of the
* affected URL in temporary storage.
* <p/>
* <p>If the HTTP DELETE request is incorrectly formatted,
* <code>doDelete</code> returns an HTTP "Bad Request"
* message.
*
* @param req the {@link HttpServletRequest} object that
* contains the request the client made of
* the servlet
* @param resp the {@link HttpServletResponse} object that
* contains the response the servlet returns
* to the client
* @throws IOException if an input or output error occurs
* while the servlet is handling the
* DELETE request
* @throws ServletException if the request for the
* DELETE cannot be handled
*/
protected void doDelete(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException {
String protocol = req.getProtocol();
String msg = lStrings.getString("http.method_delete_not_supported");
if (protocol.endsWith("1.1")) {
resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
} else {
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
}
}
private static Method[] getAllDeclaredMethods(Class c) {
if (c.equals(javax.servlet.http.HttpServlet.class)) {
return null;
}
Method[] parentMethods = getAllDeclaredMethods(c.getSuperclass());
Method[] thisMethods = c.getDeclaredMethods();
if ((parentMethods != null) && (parentMethods.length > 0)) {
Method[] allMethods =
new Method[parentMethods.length + thisMethods.length];
System.arraycopy(parentMethods, 0, allMethods, 0,
parentMethods.length);
System.arraycopy(thisMethods, 0, allMethods, parentMethods.length,
thisMethods.length);
thisMethods = allMethods;
}
return thisMethods;
}
/**
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a OPTIONS request.
* <p/>
* The OPTIONS request determines which HTTP methods
* the server supports and
* returns an appropriate header. For example, if a servlet
* overrides <code>doGet</code>, this method returns the
* following header:
* <p/>
* <p><code>Allow: GET, HEAD, TRACE, OPTIONS</code>
* <p/>
* <p>There's no need to override this method unless the
* servlet implements new HTTP methods, beyond those
* implemented by HTTP 1.1.
*
* @param req the {@link HttpServletRequest} object that
* contains the request the client made of
* the servlet
* @param resp the {@link HttpServletResponse} object that
* contains the response the servlet returns
* to the client
* @throws IOException if an input or output error occurs
* while the servlet is handling the
* OPTIONS request
* @throws ServletException if the request for the
* OPTIONS cannot be handled
*/
protected void doOptions(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
Method[] methods = getAllDeclaredMethods(this.getClass());
boolean ALLOW_GET = false;
boolean ALLOW_HEAD = false;
boolean ALLOW_POST = false;
boolean ALLOW_PUT = false;
boolean ALLOW_DELETE = false;
boolean ALLOW_TRACE = true;
boolean ALLOW_OPTIONS = true;
for (int i = 0; i < methods.length; i++) {
Method m = methods[i];
if (m.getName().equals("doGet")) {
ALLOW_GET = true;
ALLOW_HEAD = true;
}
if (m.getName().equals("doPost"))
ALLOW_POST = true;
if (m.getName().equals("doPut"))
ALLOW_PUT = true;
if (m.getName().equals("doDelete"))
ALLOW_DELETE = true;
}
String allow = null;
if (ALLOW_GET)
if (allow == null) allow = METHOD_GET;
if (ALLOW_HEAD)
if (allow == null) allow = METHOD_HEAD;
else allow += ", " + METHOD_HEAD;
if (ALLOW_POST)
if (allow == null) allow = METHOD_POST;
else allow += ", " + METHOD_POST;
if (ALLOW_PUT)
if (allow == null) allow = METHOD_PUT;
else allow += ", " + METHOD_PUT;
if (ALLOW_DELETE)
if (allow == null) allow = METHOD_DELETE;
else allow += ", " + METHOD_DELETE;
if (ALLOW_TRACE)
if (allow == null) allow = METHOD_TRACE;
else allow += ", " + METHOD_TRACE;
if (ALLOW_OPTIONS)
if (allow == null) allow = METHOD_OPTIONS;
else allow += ", " + METHOD_OPTIONS;
resp.setHeader("Allow", allow);
}
/**
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a TRACE request.
* <p/>
* A TRACE returns the headers sent with the TRACE
* request to the client, so that they can be used in
* debugging. There's no need to override this method.
*
* @param req the {@link HttpServletRequest} object that
* contains the request the client made of
* the servlet
* @param resp the {@link HttpServletResponse} object that
* contains the response the servlet returns
* to the client
* @throws IOException if an input or output error occurs
* while the servlet is handling the
* TRACE request
* @throws ServletException if the request for the
* TRACE cannot be handled
*/
protected void doTrace(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
int responseLength;
String CRLF = "\r\n";
String responseString = "TRACE " + req.getRequestURI() +
" " + req.getProtocol();
Enumeration reqHeaderEnum = req.getHeaderNames();
while (reqHeaderEnum.hasMoreElements()) {
String headerName = (String) reqHeaderEnum.nextElement();
responseString += CRLF + headerName + ": " +
req.getHeader(headerName);
}
responseString += CRLF;
responseLength = responseString.length();
resp.setContentType("message/http");
resp.setContentLength(responseLength);
ServletOutputStream out = resp.getOutputStream();
out.print(responseString);
out.close();
return;
}
/**
* Receives standard HTTP requests from the public
* <code>service</code> method and dispatches
* them to the <code>do</code><i>XXX</i> methods defined in
* this class. This method is an HTTP-specific version of the
* {@link javax.servlet.Servlet#service} method. There's no
* need to override this method.
*
* @param req the {@link HttpServletRequest} object that
* contains the request the client made of
* the servlet
* @param resp the {@link HttpServletResponse} object that
* contains the response the servlet returns
* to the client
* @throws IOException if an input or output error occurs
* while the servlet is handling the
* HTTP request
* @throws ServletException if the HTTP request
* cannot be handled
* @see javax.servlet.Servlet#service
*/
protected void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String method = req.getMethod();
if (method.equals(METHOD_GET)) {
long lastModified = getLastModified(req);
if (lastModified == -1) {
// servlet doesn't support if-modified-since, no reason
// to go through further expensive logic
doGet(req, resp);
} else {
long ifModifiedSince = req.getDateHeader(HEADER_IFMODSINCE);
if (ifModifiedSince < (lastModified / 1000 * 1000)) {
// If the servlet mod time is later, call doGet()
// Round down to the nearest second for a proper compare
// A ifModifiedSince of -1 will always be less
maybeSetLastModified(resp, lastModified);
doGet(req, resp);
} else {
resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
}
}
} else if (method.equals(METHOD_HEAD)) {
long lastModified = getLastModified(req);
maybeSetLastModified(resp, lastModified);
doHead(req, resp);
} else if (method.equals(METHOD_POST)) {
doPost(req, resp);
} else if (method.equals(METHOD_PUT)) {
doPut(req, resp);
} else if (method.equals(METHOD_DELETE)) {
doDelete(req, resp);
} else if (method.equals(METHOD_OPTIONS)) {
doOptions(req, resp);
} else if (method.equals(METHOD_TRACE)) {
doTrace(req, resp);
} else {
//
// Note that this means NO servlet supports whatever
// method was requested, anywhere on this server.
//
String errMsg = lStrings.getString("http.method_not_implemented");
Object[] errArgs = new Object[1];
errArgs[0] = method;
errMsg = MessageFormat.format(errMsg, errArgs);
resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED, errMsg);
}
}
/*
* Sets the Last-Modified entity header field, if it has not
* already been set and if the value is meaningful. Called before
* doGet, to ensure that headers are set before response data is
* written. A subclass might have set this header already, so we
* check.
*/
private void maybeSetLastModified(HttpServletResponse resp,
long lastModified) {
if (resp.containsHeader(HEADER_LASTMOD))
return;
if (lastModified >= 0)
resp.setDateHeader(HEADER_LASTMOD, lastModified);
}
/**
* Dispatches client requests to the protected
* <code>service</code> method. There's no need to
* override this method.
*
* @param req the {@link HttpServletRequest} object that
* contains the request the client made of
* the servlet
* @param res the {@link HttpServletResponse} object that
* contains the response the servlet returns
* to the client
* @throws IOException if an input or output error occurs
* while the servlet is handling the
* HTTP request
* @throws ServletException if the HTTP request cannot
* be handled
* @see javax.servlet.Servlet#service
*/
public void service(ServletRequest req, ServletResponse res)
throws ServletException, IOException {
HttpServletRequest request;
HttpServletResponse response;
try {
request = (HttpServletRequest) req;
response = (HttpServletResponse) res;
} catch (ClassCastException e) {
throw new ServletException("non-HTTP request or response");
}
service(request, response);
}
}
/*
* A response that includes no body, for use in (dumb) "HEAD" support.
* This just swallows that body, counting the bytes in order to set
* the content length appropriately. All other methods delegate directly
* to the HTTP Servlet Response object used to construct this one.
*/
// file private
class NoBodyResponse extends HttpServletResponseWrapper {
private NoBodyOutputStream noBody;
private PrintWriter writer;
private boolean didSetContentLength;
// file private
NoBodyResponse(HttpServletResponse r) {
super(r);
noBody = new NoBodyOutputStream();
}
// file private
void setContentLength() {
if (!didSetContentLength)
super.setContentLength(noBody.getContentLength());
}
// SERVLET RESPONSE interface methods
public void setContentLength(int len) {
super.setContentLength(len);
didSetContentLength = true;
}
public ServletOutputStream getOutputStream() throws IOException {
return noBody;
}
public PrintWriter getWriter() throws UnsupportedEncodingException {
if (writer == null) {
OutputStreamWriter w;
w = new OutputStreamWriter(noBody, getCharacterEncoding());
writer = new PrintWriter(w);
}
return writer;
}
}
/*
* Servlet output stream that gobbles up all its data.
*/
// file private
class NoBodyOutputStream extends ServletOutputStream {
private static final String LSTRING_FILE =
"javax.servlet.http.LocalStrings";
private static ResourceBundle lStrings =
ResourceBundle.getBundle(LSTRING_FILE);
private int contentLength = 0;
// file private
NoBodyOutputStream() {
}
// file private
int getContentLength() {
return contentLength;
}
public void write(int b) {
contentLength++;
}
public void write(byte buf[], int offset, int len)
throws IOException {
if (len >= 0) {
contentLength += len;
} else {
// XXX
// isn't this really an IllegalArgumentException?
String msg = lStrings.getString("err.io.negativelength");
throw new IOException("negative length");
}
}
}
| 16 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/http/HttpUtils.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 javax.servlet.http;
import javax.servlet.ServletInputStream;
import java.util.Hashtable;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.io.IOException;
/**
* @version $Rev$ $Date$
* @deprecated As of Java(tm) Servlet API 2.3.
* These methods were only useful
* with the default encoding and have been moved
* to the request interfaces.
*/
public class HttpUtils {
private static final String LSTRING_FILE =
"javax.servlet.http.LocalStrings";
private static ResourceBundle lStrings =
ResourceBundle.getBundle(LSTRING_FILE);
/**
* Constructs an empty <code>HttpUtils</code> object.
*/
public HttpUtils() {
}
/**
* Parses a query string passed from the client to the
* server and builds a <code>HashTable</code> object
* with key-value pairs.
* The query string should be in the form of a string
* packaged by the GET or POST method, that is, it
* should have key-value pairs in the form <i>key=value</i>,
* with each pair separated from the next by a & character.
* <p/>
* <p>A key can appear more than once in the query string
* with different values. However, the key appears only once in
* the hashtable, with its value being
* an array of strings containing the multiple values sent
* by the query string.
* <p/>
* <p>The keys and values in the hashtable are stored in their
* decoded form, so
* any + characters are converted to spaces, and characters
* sent in hexadecimal notation (like <i>%xx</i>) are
* converted to ASCII characters.
*
* @param s a string containing the query to be parsed
* @return a <code>HashTable</code> object built
* from the parsed key-value pairs
* @throws IllegalArgumentException if the query string
* is invalid
*/
static public Hashtable<String, String[]> parseQueryString(String s) {
String valArray[];
if (s == null) {
throw new IllegalArgumentException();
}
Hashtable<String, String[]> ht = new Hashtable<String, String[]>();
StringBuffer sb = new StringBuffer();
StringTokenizer st = new StringTokenizer(s, "&");
while (st.hasMoreTokens()) {
String pair = st.nextToken();
int pos = pair.indexOf('=');
if (pos == -1) {
// XXX
// should give more detail about the illegal argument
throw new IllegalArgumentException();
}
String key = parseName(pair.substring(0, pos), sb);
String val = parseName(pair.substring(pos + 1, pair.length()), sb);
if (ht.containsKey(key)) {
String oldVals[] = ht.get(key);
valArray = new String[oldVals.length + 1];
System.arraycopy(oldVals, 0, valArray, 0, oldVals.length);
valArray[oldVals.length] = val;
} else {
valArray = new String[1];
valArray[0] = val;
}
ht.put(key, valArray);
}
return ht;
}
/**
* Parses data from an HTML form that the client sends to
* the server using the HTTP POST method and the
* <i>application/x-www-form-urlencoded</i> MIME type.
* <p/>
* <p>The data sent by the POST method contains key-value
* pairs. A key can appear more than once in the POST data
* with different values. However, the key appears only once in
* the hashtable, with its value being
* an array of strings containing the multiple values sent
* by the POST method.
* <p/>
* <p>The keys and values in the hashtable are stored in their
* decoded form, so
* any + characters are converted to spaces, and characters
* sent in hexadecimal notation (like <i>%xx</i>) are
* converted to ASCII characters.
*
* @param len an integer specifying the length,
* in characters, of the
* <code>ServletInputStream</code>
* object that is also passed to this
* method
* @param in the <code>ServletInputStream</code>
* object that contains the data sent
* from the client
* @return a <code>HashTable</code> object built
* from the parsed key-value pairs
* @throws IllegalArgumentException if the data
* sent by the POST method is invalid
*/
static public Hashtable<String, String[]> parsePostData(int len,
ServletInputStream in) {
// XXX
// should a length of 0 be an IllegalArgumentException
if (len <= 0)
return new Hashtable<String, String[]>(); // cheap hack to return an empty hash
if (in == null) {
throw new IllegalArgumentException();
}
//
// Make sure we read the entire POSTed body.
//
byte[] postedBytes = new byte[len];
try {
int offset = 0;
do {
int inputLen = in.read(postedBytes, offset, len - offset);
if (inputLen <= 0) {
String msg = lStrings.getString("err.io.short_read");
throw new IllegalArgumentException(msg);
}
offset += inputLen;
} while ((len - offset) > 0);
} catch (IOException e) {
throw new IllegalArgumentException(e.getMessage());
}
// XXX we shouldn't assume that the only kind of POST body
// is FORM data encoded using ASCII or ISO Latin/1 ... or
// that the body should always be treated as FORM data.
//
try {
String postedBody = new String(postedBytes, 0, len, "8859_1");
return parseQueryString(postedBody);
} catch (java.io.UnsupportedEncodingException e) {
// XXX function should accept an encoding parameter & throw this
// exception. Otherwise throw something expected.
throw new IllegalArgumentException(e.getMessage());
}
}
/*
* Parse a name in the query string.
*/
static private String parseName(String s, StringBuffer sb) {
sb.setLength(0);
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
switch (c) {
case '+':
sb.append(' ');
break;
case '%':
try {
sb.append((char) Integer.parseInt(s.substring(i + 1, i + 3),
16));
i += 2;
} catch (NumberFormatException e) {
// XXX
// need to be more specific about illegal arg
throw new IllegalArgumentException();
} catch (StringIndexOutOfBoundsException e) {
String rest = s.substring(i);
sb.append(rest);
if (rest.length() == 2)
i++;
}
break;
default:
sb.append(c);
break;
}
}
return sb.toString();
}
/**
* Reconstructs the URL the client used to make the request,
* using information in the <code>HttpServletRequest</code> object.
* The returned URL contains a protocol, server name, port
* number, and server path, but it does not include query
* string parameters.
* <p/>
* <p>Because this method returns a <code>StringBuffer</code>,
* not a string, you can modify the URL easily, for example,
* to append query parameters.
* <p/>
* <p>This method is useful for creating redirect messages
* and for reporting errors.
*
* @param req a <code>HttpServletRequest</code> object
* containing the client's request
* @return a <code>StringBuffer</code> object containing
* the reconstructed URL
*/
public static StringBuffer getRequestURL(HttpServletRequest req) {
StringBuffer url = new StringBuffer();
String scheme = req.getScheme();
int port = req.getServerPort();
String urlPath = req.getRequestURI();
//String servletPath = req.getServletPath ();
//String pathInfo = req.getPathInfo ();
url.append(scheme); // http, https
url.append("://");
url.append(req.getServerName());
if ((scheme.equals("http") && port != 80)
|| (scheme.equals("https") && port != 443)) {
url.append(':');
url.append(req.getServerPort());
}
//if (servletPath != null)
// url.append (servletPath);
//if (pathInfo != null)
// url.append (pathInfo);
url.append(urlPath);
return url;
}
}
| 17 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/descriptor/TaglibDescriptor.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 javax.servlet.descriptor;
/**
* @version $Rev$ $Date$
* @since Servlet 3.0
*/
public interface TaglibDescriptor {
String getTaglibLocation();
String getTaglibURI();
}
| 18 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/descriptor/JspConfigDescriptor.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 javax.servlet.descriptor;
import java.util.Collection;
/**
* @version $Rev$ $Date$
* @since Servlet 3.0
*/
public interface JspConfigDescriptor {
Collection<JspPropertyGroupDescriptor> getJspPropertyGroups();
Collection<TaglibDescriptor> getTaglibs();
}
| 19 |
0 | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet | Create_ds/geronimo-specs/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.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 javax.servlet.descriptor;
import java.util.Collection;
/**
* @version $Rev$ $Date$
* @since Servlet 3.0
*/
public interface JspPropertyGroupDescriptor {
String getBuffer();
String getDefaultContentType();
String getDeferredSyntaxAllowedAsLiteral();
String getElIgnored();
String getErrorOnUndeclaredNamespace();
Collection<String> getIncludeCodas();
Collection<String> getIncludePreludes();
String getIsXml();
String getPageEncoding();
String getScriptingInvalid();
String getTrimDirectiveWhitespaces();
Collection<String> getUrlPatterns();
}
| 20 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/ManagedScheduledExecutorService.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 javax.enterprise.concurrent;
import java.util.concurrent.Callable;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
public interface ManagedScheduledExecutorService extends ManagedExecutorService, ScheduledExecutorService {
ScheduledFuture<?> schedule(Runnable command, Trigger trigger);
<V> ScheduledFuture<V> schedule(Callable<V> callable, Trigger trigger);
}
| 21 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/AbortedException.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 javax.enterprise.concurrent;
import java.util.concurrent.ExecutionException;
/**
* Exception indicating that the result of a value-producing task, cannot be retrieved because the
* task run was aborted.<p>
*
* Use the {@link java.lang.Throwable#getCause()} method to determine why the task aborted.
*/
public class AbortedException extends ExecutionException {
private static final long serialVersionUID = 8313294757663362709L;
/**
* Constructs an AbortedException with <code>null</code> as its detail message.
* The cause is not initialized, and may subsequently be initialized by a call to
* {@link java.lang.Throwable#initCause(java.lang.Throwable)}.
*/
public AbortedException() {
super();
}
/**
* Constructs an AbortedException exception with the specified detail message and cause.<p>
*
* Note that the detail message associated with cause is not automatically incorporated in
* this exception's detail message.
*
* @param message the detail message (which is saved for later retrieval by the {@link java.lang.Throwable#getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the {@link java.lang.Throwable#getCause()} method).
* (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
public AbortedException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructs an AbortedException exception with the specified detail message.<p>
*
* The cause is not initialized, and may subsequently be initialized by a call to
* {@link java.lang.Throwable#initCause(java.lang.Throwable)}.
*
* @param message the detail message (which is saved for later retrieval by the {@link java.lang.Throwable#getMessage()} method).
*/
public AbortedException(String message) {
super(message);
}
/**
* Constructs an AbortedException exception with the specified cause and a
* detail message of (cause==null ? null : cause.toString())
* (which typically contains the class and detail message of cause).
*
* @param cause the cause (which is saved for later retrieval by the {@link java.lang.Throwable#getCause()} method).
* (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
public AbortedException(Throwable cause) {
super(cause);
}
}
| 22 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/ManagedExecutors.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 javax.enterprise.concurrent;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;
public class ManagedExecutors {
public static final String NULL_TASK_ERROR_MSG = "Task cannot be null";
public static boolean isCurrentThreadShutdown() {
final Thread currThread = Thread.currentThread();
return currThread instanceof ManageableThread && ManageableThread.class.cast(currThread).isShutdown();
}
public static Runnable managedTask(final Runnable task, final ManagedTaskListener taskListener)
throws IllegalArgumentException {
return managedTask(task, null, taskListener);
}
public static Runnable managedTask(final Runnable task, final Map<String, String> executionProperties,
final ManagedTaskListener taskListener) throws IllegalArgumentException {
if (task == null) {
throw new IllegalArgumentException(NULL_TASK_ERROR_MSG);
}
return new RunnableAdapter(task, executionProperties, taskListener);
}
public static <V> Callable<V> managedTask(final Callable<V> task, final ManagedTaskListener taskListener)
throws IllegalArgumentException {
return managedTask(task, null, taskListener);
}
public static <V> Callable<V> managedTask(final Callable<V> task,
final Map<String, String> executionProperties,
final ManagedTaskListener taskListener) throws IllegalArgumentException {
if (task == null) {
throw new IllegalArgumentException(NULL_TASK_ERROR_MSG);
}
return new CallableAdapter<V>(task, executionProperties, taskListener);
}
private static final class RunnableAdapter extends Adapter implements Runnable {
private final Runnable task;
public RunnableAdapter(final Runnable task, final Map<String, String> executionProperties,
final ManagedTaskListener taskListener) {
super(taskListener, executionProperties, ManagedTask.class.isInstance(task) ? ManagedTask.class.cast(task) : null);
this.task = task;
}
@Override
public void run() {
task.run();
}
}
/**
* Adapter for Callable to include ManagedTask interface methods
*/
private static final class CallableAdapter<V> extends Adapter implements Callable<V> {
private final Callable<V> task;
public CallableAdapter(final Callable<V> task, final Map<String, String> executionProperties,
final ManagedTaskListener taskListener) {
super(taskListener, executionProperties, ManagedTask.class.isInstance(task) ? ManagedTask.class.cast(task) : null);
this.task = task;
}
@Override
public V call() throws Exception {
return task.call();
}
}
private static class Adapter implements ManagedTask {
protected final ManagedTaskListener taskListener;
protected final Map<String, String> executionProperties;
protected final ManagedTask managedTask;
public Adapter(ManagedTaskListener taskListener, Map<String, String> executionProperties, ManagedTask managedTask) {
this.taskListener = taskListener;
this.managedTask = managedTask;
this.executionProperties =
initExecutionProperties(managedTask == null? null: managedTask.getExecutionProperties(),
executionProperties);
}
@Override
public ManagedTaskListener getManagedTaskListener() {
if (taskListener != null) {
return taskListener;
}
if (managedTask != null) {
return managedTask.getManagedTaskListener();
}
return null;
}
@Override
public Map<String, String> getExecutionProperties() {
if (executionProperties != null) {
return executionProperties;
}
return null;
}
private static Map<String, String> initExecutionProperties(final Map<String, String> base,
final Map<String, String> override) {
if (base == null && override == null) {
return null;
}
final Map<String, String> props = new HashMap<String, String>();
if (base != null) {
props.putAll(base);
}
if (override != null) {
props.putAll(override);
}
return props;
}
}
private ManagedExecutors() {
// no-op
}
}
| 23 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/ManagedTask.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 javax.enterprise.concurrent;
import java.util.Map;
public interface ManagedTask {
String LONGRUNNING_HINT = "javax.enterprise.concurrent.LONGRUNNING_HINT";
String TRANSACTION = "javax.enterprise.concurrent.TRANSACTION";
String SUSPEND = "SUSPEND";
String USE_TRANSACTION_OF_EXECUTION_THREAD = "USE_TRANSACTION_OF_EXECUTION_THREAD";
String IDENTITY_NAME = "javax.enterprise.concurrent.IDENTITY_NAME";
ManagedTaskListener getManagedTaskListener();
Map<String, String> getExecutionProperties();
}
| 24 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/ManagedThreadFactory.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 javax.enterprise.concurrent;
import java.util.concurrent.ThreadFactory;
public interface ManagedThreadFactory extends ThreadFactory {
}
| 25 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/Trigger.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 javax.enterprise.concurrent;
import java.util.Date;
public interface Trigger {
Date getNextRunTime(LastExecution lastExecutionInfo, Date taskScheduledTime);
boolean skipRun(LastExecution lastExecutionInfo, Date scheduledRunTime);
}
| 26 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/LastExecution.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 javax.enterprise.concurrent;
import java.util.Date;
public interface LastExecution {
String getIdentityName();
Object getResult();
Date getScheduledStart();
Date getRunStart();
Date getRunEnd();
}
| 27 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/ManagedExecutorService.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 javax.enterprise.concurrent;
import java.util.concurrent.ExecutorService;
public interface ManagedExecutorService extends ExecutorService {
}
| 28 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/SkippedException.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 javax.enterprise.concurrent;
import java.io.Serializable;
import java.util.concurrent.ExecutionException;
public class SkippedException extends ExecutionException implements Serializable {
private static final long serialVersionUID = 6296866815328432550L;
public SkippedException() {
super();
}
public SkippedException(java.lang.String message) {
super(message);
}
public SkippedException(java.lang.String message,
java.lang.Throwable cause) {
super(message, cause);
}
public SkippedException(java.lang.Throwable cause) {
super(cause);
}
}
| 29 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/ManagedTaskListener.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 javax.enterprise.concurrent;
import java.util.concurrent.Future;
public interface ManagedTaskListener {
void taskSubmitted(Future<?> future, ManagedExecutorService executor, Object task);
void taskAborted(Future<?> future, ManagedExecutorService executor, Object task, Throwable exception);
void taskDone(Future<?> future, ManagedExecutorService executor, Object task, Throwable exception);
void taskStarting(Future<?> future, ManagedExecutorService executor, Object task);
}
| 30 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/ManageableThread.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 javax.enterprise.concurrent;
public interface ManageableThread {
boolean isShutdown();
}
| 31 |
0 | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-concurrent_1.0_spec/src/main/java/javax/enterprise/concurrent/ContextService.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 javax.enterprise.concurrent;
import java.util.Map;
public interface ContextService {
<T> T createContextualProxy(T instance, Class<T> intf);
Object createContextualProxy(Object instance, Class<?>... interfaces);
<T> T createContextualProxy(T instance, Map<String, String> executionProperties, Class<T> intf);
Object createContextualProxy(Object instance, Map<String, String> executionProperties, Class<?>... interfaces);
Map<String, String> getExecutionProperties(Object contextualProxy);
}
| 32 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/XMLConstants.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 javax.xml;
public class XMLConstants {
public static final java.lang.String DEFAULT_NS_PREFIX = "";
public static final java.lang.String XML_NS_PREFIX = "xml";
public static final java.lang.String XML_NS_URI = "http://www.w3.org/XML/1998/namespace";
public static final java.lang.String XMLNS_ATTRIBUTE = "xmlns";
public static final java.lang.String XMLNS_ATTRIBUTE_NS_URI = "http://www.w3.org/2000/xmlns/";
}
| 33 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLReporter.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 javax.xml.stream;
public interface XMLReporter {
void report(String message,
String errorType,
Object relatedInformation,
Location location) throws XMLStreamException;
}
| 34 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/FactoryConfigurationError.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 javax.xml.stream;
import java.io.Serializable;
public class FactoryConfigurationError extends Error implements Serializable {
Exception nested;
public FactoryConfigurationError() {
}
public FactoryConfigurationError(Exception e) {
super(e);
nested = e;
}
public FactoryConfigurationError(Exception e, String msg) {
super(msg, e);
nested = e;
}
public FactoryConfigurationError(java.lang.String msg) {
super(msg);
}
public FactoryConfigurationError(String msg, Exception e) {
super(msg, e);
nested = e;
}
public Exception getException() {
return nested;
}
public String getMessage() {
String msg = super.getMessage();
if (msg != null)
return msg;
if (nested != null) {
msg = nested.getMessage();
if (msg == null)
msg = nested.getClass().toString();
}
return msg;
}
} | 35 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/FactoryLocator.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 javax.xml.stream;
import java.io.InputStream;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.apache.geronimo.osgi.locator.ProviderLocator;
/*
* Here is the beef on the finding the Factory Class
*
* 1. Use the javax.xml.stream.XMLInputFactory system property. 2. Use the
* properties file "lib/stax.properties" in the JRE directory. This
* configuration file is in standard java.util.Properties format and contains
* the fully qualified name of the implementation class with the key being the
* system property defined above. 3. Use the Services API (as detailed in the
* JAR specification), if available, to determine the classname. The Services
* API will look for a classname in the file
* META-INF/services/javax.xml.stream.XMLInputFactory in jars available to the
* runtime. Platform default XMLInputFactory instance.
*
* If the user provided a classloader we'll use that...if not, we'll assume the
* classloader of this class.
*/
class FactoryLocator {
static Object locate(String factoryId) throws FactoryConfigurationError {
return locate(factoryId, null);
}
static Object locate(String factoryId, String altClassName)
throws FactoryConfigurationError {
return locate(factoryId, altClassName,
Thread.currentThread().getContextClassLoader());
}
static Object locate(String factoryId, String altClassName,
ClassLoader classLoader) throws FactoryConfigurationError {
// NOTE: The stax spec uses the following lookup order, which is the reverse from what is specified
// most of the APIs:
// 1. Use the javax.xml.stream.XMLInputFactory system property.
// 2. Use the properties file lib/xml.stream.properties in the JRE directory. This configuration
// file is in standard java.util.Properties format and contains the fully qualified name of the
// implementation class with the key being the system property defined in step 1.
// 3. Use the Services API (as detailed in the JAR specification), if available, to determine the
// classname. The Services API looks for a classname in the file META-INF/services/
// javax.xml.stream.XMLInputFactory in jars available to the runtime.
// 4. Platform default XMLInputFactory instance.
// Use the system property first
try {
String systemProp = System.getProperty(factoryId);
if (systemProp != null) {
return newInstance(systemProp, classLoader);
}
} catch (SecurityException se) {
}
try {
// NOTE: The StAX spec gives this property file name as xml.stream.properties, but the javadoc and the maintenance release
// state this is stax.properties.
String factoryClassName = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "stax.properties", factoryId);
if (factoryClassName != null) {
return newInstance(factoryClassName, classLoader);
}
} catch (Exception ex) {
}
try {
// check the META-INF/services definitions, and return it if
// we find something.
Object service = ProviderLocator.getService(factoryId, FactoryLocator.class, classLoader);
if (service != null) {
return service;
}
} catch (Exception ex) {
}
if (altClassName == null) {
throw new FactoryConfigurationError("Unable to locate factory for "
+ factoryId + ".", null);
}
return newInstance(altClassName, classLoader);
}
private static Object newInstance(String className, ClassLoader classLoader)
throws FactoryConfigurationError {
try {
return ProviderLocator.loadClass(className, FactoryLocator.class, classLoader).newInstance();
} catch (ClassNotFoundException x) {
throw new FactoryConfigurationError("Requested factory "
+ className + " cannot be located. Classloader ="
+ classLoader.toString(), x);
} catch (Exception x) {
throw new FactoryConfigurationError("Requested factory "
+ className + " could not be instantiated: " + x, x);
}
}
}
| 36 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLEventFactory.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 javax.xml.stream;
import java.util.Iterator;
import javax.xml.namespace.NamespaceContext;
import javax.xml.stream.events.ProcessingInstruction;
import javax.xml.namespace.QName;
import javax.xml.stream.events.Characters;
import javax.xml.stream.events.Comment;
import javax.xml.stream.events.DTD;
import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.EntityDeclaration;
import javax.xml.stream.events.Namespace;
import javax.xml.stream.events.Attribute;
import javax.xml.stream.events.EndDocument;
import javax.xml.stream.events.EntityReference;
import javax.xml.stream.events.StartDocument;
import javax.xml.stream.events.StartElement;
public abstract class XMLEventFactory {
protected XMLEventFactory() {
}
public static XMLEventFactory newInstance() throws FactoryConfigurationError {
return (XMLEventFactory)FactoryLocator.locate("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory");
}
public static XMLEventFactory newFactory() throws FactoryConfigurationError {
return (XMLEventFactory)FactoryLocator.locate("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory");
}
/**
* Create a new XMLEventFactory
*
* @deprecated to maintain API consistency. All newInstance methods are
* replaced with corresponding newFactory methods. The replacement
* newFactory(String factoryId, ClassLoader classLoader)
* method defines no changes in behavior from this method.
*/
public static XMLEventFactory newInstance(String factoryId,
ClassLoader classLoader) throws FactoryConfigurationError {
return (XMLEventFactory)FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxEventFactory", classLoader);
}
public static XMLEventFactory newFactory(String factoryId,
ClassLoader classLoader) throws FactoryConfigurationError {
return (XMLEventFactory)FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxEventFactory", classLoader);
}
public abstract void setLocation(Location location);
public abstract Attribute createAttribute(QName name, String value);
public abstract Attribute createAttribute(String localName, String value);
public abstract Attribute createAttribute(String prefix,
String namespaceURI, String localName, String value);
public abstract Namespace createNamespace(String namespaceUri);
public abstract Namespace createNamespace(String prefix, String namespaceUri);
public abstract StartElement createStartElement(QName name,
Iterator attributes, Iterator namespaces);
public abstract StartElement createStartElement(String prefix,
String namespaceUri, String localName);
public abstract StartElement createStartElement(String prefix,
String namespaceUri, String localName, Iterator attributes,
Iterator namespaces);
public abstract StartElement createStartElement(String prefix,
String namespaceUri, String localName, Iterator attributes,
Iterator namespaces, NamespaceContext context);
public abstract EndElement createEndElement(QName name, Iterator namespaces);
public abstract EndElement createEndElement(String prefix,
String namespaceUri, String localName);
public abstract EndElement createEndElement(String prefix,
String namespaceUri, String localName, Iterator namespaces);
public abstract Characters createCharacters(String content);
public abstract Characters createCData(String content);
public abstract Characters createSpace(String content);
public abstract Characters createIgnorableSpace(String content);
public abstract StartDocument createStartDocument();
public abstract StartDocument createStartDocument(String encoding);
public abstract StartDocument createStartDocument(String encoding,
String version);
public abstract StartDocument createStartDocument(String encoding,
String version, boolean standalone);
public abstract EndDocument createEndDocument();
public abstract EntityReference createEntityReference(String name,
EntityDeclaration declaration);
public abstract Comment createComment(String text);
public abstract ProcessingInstruction createProcessingInstruction(
String target, String data);
public abstract DTD createDTD(String dtd);
}
| 37 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLEventReader.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 javax.xml.stream;
import java.util.Iterator;
import javax.xml.stream.events.XMLEvent;
public interface XMLEventReader extends Iterator {
public void close() throws XMLStreamException;
public String getElementText() throws XMLStreamException;
public Object getProperty(java.lang.String name)
throws IllegalArgumentException;
public boolean hasNext();
public XMLEvent nextEvent() throws XMLStreamException;
public XMLEvent nextTag() throws XMLStreamException;
public XMLEvent peek() throws XMLStreamException;
}
| 38 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLEventWriter.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 javax.xml.stream;
import javax.xml.namespace.NamespaceContext;
import javax.xml.stream.events.XMLEvent;
import javax.xml.stream.util.XMLEventConsumer;
public interface XMLEventWriter extends XMLEventConsumer {
public void add(XMLEvent event) throws XMLStreamException;
public void add(XMLEventReader reader) throws XMLStreamException;
public void close() throws XMLStreamException;
public void flush() throws XMLStreamException;
public NamespaceContext getNamespaceContext();
public String getPrefix(String uri) throws XMLStreamException;
public void setDefaultNamespace(String uri) throws XMLStreamException;
public void setNamespaceContext(NamespaceContext context)
throws XMLStreamException;
public void setPrefix(String prefix, String uri) throws XMLStreamException;
}
| 39 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/StreamFilter.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 javax.xml.stream;
public interface StreamFilter {
public boolean accept(XMLStreamReader reader);
} | 40 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLStreamConstants.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 javax.xml.stream;
public interface XMLStreamConstants {
public static final int ATTRIBUTE = 10;
public static final int CDATA = 12;
public static final int CHARACTERS = 4;
public static final int COMMENT = 5;
public static final int DTD = 11;
public static final int END_DOCUMENT = 8;
public static final int END_ELEMENT = 2;
public static final int ENTITY_DECLARATION = 15;
public static final int ENTITY_REFERENCE = 9;
public static final int NAMESPACE = 13;
public static final int NOTATION_DECLARATION = 14;
public static final int PROCESSING_INSTRUCTION = 3;
public static final int SPACE = 6;
public static final int START_DOCUMENT = 7;
public static final int START_ELEMENT = 1;
} | 41 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLOutputFactory.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 javax.xml.stream;
public abstract class XMLOutputFactory {
public static final String IS_REPAIRING_NAMESPACES = "javax.xml.stream.isRepairingNamespaces";
protected XMLOutputFactory() { }
public static XMLOutputFactory newInstance() throws FactoryConfigurationError {
return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory");
}
/**
* Create a new XMLOutputFactory
*
* @deprecated This method has been deprecated because
* it returns an instance of XMLInputFactory, which is of the
* wrong class. Use the new method
* newFactory(java.lang.String factoryId,java.lang.ClassLoader classLoader)
* instead.
*/
public static XMLInputFactory newInstance(String factoryId,
java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
return (XMLInputFactory) FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxOutputFactory", classLoader);
}
/**
* Create a new XMLOutputFactory
*
* This is the replacement for the deprecated newInstance() method
*/
public static XMLOutputFactory newFactory() throws FactoryConfigurationError {
return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory");
}
/**
* Create a new XMLOutputFactory
*
* This is the replacement for the deprecated newInstance() method
*/
public static XMLOutputFactory newFactory(String factoryId, ClassLoader classLoader)
throws FactoryConfigurationError {
// essentially the same thing as deprecated newInstance(), but the correct return type.
return (XMLOutputFactory) FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxOutputFactory", classLoader);
}
public abstract XMLStreamWriter createXMLStreamWriter(java.io.Writer stream)
throws XMLStreamException;
public abstract XMLStreamWriter createXMLStreamWriter(
java.io.OutputStream stream) throws XMLStreamException;
public abstract XMLStreamWriter createXMLStreamWriter(
java.io.OutputStream stream, String encoding)
throws XMLStreamException;
public abstract XMLStreamWriter createXMLStreamWriter(
javax.xml.transform.Result result) throws XMLStreamException;
public abstract XMLEventWriter createXMLEventWriter(
javax.xml.transform.Result result) throws XMLStreamException;
public abstract XMLEventWriter createXMLEventWriter(
java.io.OutputStream stream) throws XMLStreamException;
public abstract XMLEventWriter createXMLEventWriter(
java.io.OutputStream stream, String encoding)
throws XMLStreamException;
public abstract XMLEventWriter createXMLEventWriter(java.io.Writer stream)
throws XMLStreamException;
public abstract void setProperty(String name, Object value)
throws IllegalArgumentException;
public abstract Object getProperty(String name)
throws IllegalArgumentException;
public abstract boolean isPropertySupported(String name);
}
| 42 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLResolver.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 javax.xml.stream;
public interface XMLResolver {
public Object resolveEntity(String publicID,
String systemID,
String baseURI,
String namespace) throws XMLStreamException;
}
| 43 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLStreamWriter.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 javax.xml.stream;
import javax.xml.namespace.NamespaceContext;
public interface XMLStreamWriter {
public void close() throws XMLStreamException;
public void flush() throws XMLStreamException;
public NamespaceContext getNamespaceContext();
public String getPrefix(String uri) throws XMLStreamException;
public Object getProperty(String name) throws IllegalArgumentException;
public void setDefaultNamespace(String uri) throws XMLStreamException;
public void setNamespaceContext(NamespaceContext context)
throws XMLStreamException;
public void setPrefix(String prefix, String uri) throws XMLStreamException;
public void writeAttribute(String localName, String value)
throws XMLStreamException;
public void writeAttribute(String namespaceURI, String localName,
String value) throws XMLStreamException;
public void writeAttribute(String prefix, String namespaceURI,
String localName, String value) throws XMLStreamException;
public void writeCData(String data) throws XMLStreamException;
public void writeCharacters(char[] text, int start, int len)
throws XMLStreamException;
public void writeCharacters(String text) throws XMLStreamException;
public void writeComment(String data) throws XMLStreamException;
public void writeDefaultNamespace(String namespaceURI)
throws XMLStreamException;
public void writeDTD(String dtd) throws XMLStreamException;
public void writeEmptyElement(String localName) throws XMLStreamException;
public void writeEmptyElement(String namespaceURI, String localName)
throws XMLStreamException;
public void writeEmptyElement(String prefix, String localName,
String namespaceURI) throws XMLStreamException;
public void writeEndDocument() throws XMLStreamException;
public void writeEndElement() throws XMLStreamException;
public void writeEntityRef(String name) throws XMLStreamException;
public void writeNamespace(String prefix, String namespaceURI)
throws XMLStreamException;
public void writeProcessingInstruction(String target)
throws XMLStreamException;
public void writeProcessingInstruction(String target, String data)
throws XMLStreamException;
public void writeStartDocument() throws XMLStreamException;
public void writeStartDocument(String version) throws XMLStreamException;
public void writeStartDocument(String encoding, String version)
throws XMLStreamException;
public void writeStartElement(String localName) throws XMLStreamException;
public void writeStartElement(String namespaceURI, String localName)
throws XMLStreamException;
public void writeStartElement(String prefix, String localName,
String namespaceURI) throws XMLStreamException;
}
| 44 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLInputFactory.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 javax.xml.stream;
import javax.xml.stream.util.XMLEventAllocator;
public abstract class XMLInputFactory {
public static final java.lang.String ALLOCATOR = "javax.xml.stream.allocator";
public static final java.lang.String IS_COALESCING = "javax.xml.stream.isCoalescing";
public static final java.lang.String IS_NAMESPACE_AWARE = "javax.xml.stream.isNamespaceAware";
public static final java.lang.String IS_REPLACING_ENTITY_REFERENCES = "javax.xml.stream.isReplacingEntityReferences";
public static final java.lang.String IS_SUPPORTING_EXTERNAL_ENTITIES = "javax.xml.stream.isSupportingExternalEntities";
public static final java.lang.String IS_VALIDATING = "javax.xml.stream.isValidating";
public static final java.lang.String REPORTER = "javax.xml.stream.reporter";
public static final java.lang.String RESOLVER = "javax.xml.stream.resolver";
public static final java.lang.String SUPPORT_DTD = "javax.xml.stream.supportDTD";
protected XMLInputFactory() {
}
public static XMLInputFactory newInstance()
throws FactoryConfigurationError {
// We'll assume the XMLInputFactory from the RI as a backup.
return (XMLInputFactory)FactoryLocator.locate("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
}
public static XMLInputFactory newFactory()
throws FactoryConfigurationError {
// We'll assume the XMLInputFactory from the RI as a backup.
return (XMLInputFactory)FactoryLocator.locate("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
}
/**
* Create a new XMLInputFactory
*
* @deprecated to maintain API consistency. All newInstance methods are
* replaced with corresponding newFactory methods. The replacement
* newFactory(String factoryId, ClassLoader classLoader)
* method defines no changes in behavior from this method.
*/
public static XMLInputFactory newInstance(java.lang.String factoryId,
java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
// We'll assume the XMLInputFactory from the RI as a backup.
return (XMLInputFactory)FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxInputFactory", classLoader);
}
public static XMLInputFactory newFactory(java.lang.String factoryId,
java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
// We'll assume the XMLInputFactory from the RI as a backup.
return (XMLInputFactory)FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxInputFactory", classLoader);
}
public abstract XMLStreamReader createXMLStreamReader(java.io.Reader reader)
throws XMLStreamException;
public abstract XMLStreamReader createXMLStreamReader(
javax.xml.transform.Source source) throws XMLStreamException;
public abstract XMLStreamReader createXMLStreamReader(
java.io.InputStream stream) throws XMLStreamException;
public abstract XMLStreamReader createXMLStreamReader(
java.io.InputStream stream, java.lang.String encoding)
throws XMLStreamException;
public abstract XMLStreamReader createXMLStreamReader(
java.lang.String systemId, java.io.InputStream stream)
throws XMLStreamException;
public abstract XMLStreamReader createXMLStreamReader(
java.lang.String systemId, java.io.Reader reader)
throws XMLStreamException;
public abstract XMLEventReader createXMLEventReader(java.io.Reader reader)
throws XMLStreamException;
public abstract XMLEventReader createXMLEventReader(
java.lang.String systemId, java.io.Reader reader)
throws XMLStreamException;
public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
throws XMLStreamException;
public abstract XMLEventReader createXMLEventReader(
javax.xml.transform.Source source) throws XMLStreamException;
public abstract XMLEventReader createXMLEventReader(
java.io.InputStream stream) throws XMLStreamException;
public abstract XMLEventReader createXMLEventReader(
java.io.InputStream stream, java.lang.String encoding)
throws XMLStreamException;
public abstract XMLEventReader createXMLEventReader(
java.lang.String systemId, java.io.InputStream stream)
throws XMLStreamException;
public abstract XMLStreamReader createFilteredReader(
XMLStreamReader reader, StreamFilter filter)
throws XMLStreamException;
public abstract XMLEventReader createFilteredReader(XMLEventReader reader,
EventFilter filter) throws XMLStreamException;
public abstract XMLResolver getXMLResolver();
public abstract void setXMLResolver(XMLResolver resolver);
public abstract XMLReporter getXMLReporter();
public abstract void setXMLReporter(XMLReporter reporter);
public abstract void setProperty(java.lang.String name,
java.lang.Object value) throws java.lang.IllegalArgumentException;
public abstract java.lang.Object getProperty(java.lang.String name)
throws java.lang.IllegalArgumentException;
public abstract boolean isPropertySupported(java.lang.String name);
public abstract void setEventAllocator(XMLEventAllocator allocator);
public abstract XMLEventAllocator getEventAllocator();
}
| 45 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLStreamReader.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 javax.xml.stream;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
public interface XMLStreamReader extends XMLStreamConstants {
public void close() throws XMLStreamException;
public int getAttributeCount();
public String getAttributeLocalName(int index);
public QName getAttributeName(int index);
public String getAttributeNamespace(int index);
public String getAttributePrefix(int index);
public String getAttributeType(int index);
public String getAttributeValue(int index);
public String getAttributeValue(String namespaceURI,
String localName);
public String getCharacterEncodingScheme();
public String getElementText() throws XMLStreamException;
public String getEncoding();
public int getEventType();
public String getLocalName();
public Location getLocation();
public QName getName();
public NamespaceContext getNamespaceContext();
public int getNamespaceCount();
public String getNamespacePrefix(int index);
public String getNamespaceURI();
public String getNamespaceURI(int index);
public String getNamespaceURI(String prefix);
public String getPIData();
public String getPITarget();
public String getPrefix();
public java.lang.Object getProperty(String name) throws IllegalArgumentException;
public String getText();
public char[] getTextCharacters();
public int getTextCharacters(int sourceStart, char[] target, int targetStart,
int length) throws XMLStreamException;
public int getTextLength();
public int getTextStart();
public String getVersion();
public boolean hasName();
public boolean hasNext() throws XMLStreamException;
public boolean hasText();
public boolean isAttributeSpecified(int index);
public boolean isCharacters();
public boolean isEndElement();
public boolean isStandalone();
public boolean isStartElement();
public boolean isWhiteSpace();
public int next() throws XMLStreamException;
public int nextTag() throws XMLStreamException ;
public void require(int type, String namespaceURI,
String localName) throws XMLStreamException ;
public boolean standaloneSet();
}
| 46 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/Location.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 javax.xml.stream;
public interface Location {
public int getCharacterOffset();
public int getColumnNumber();
public int getLineNumber();
public String getPublicId();
public String getSystemId();
} | 47 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/XMLStreamException.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 javax.xml.stream;
public class XMLStreamException extends Exception {
protected Throwable nested;
protected Location location;
public XMLStreamException() {
}
public XMLStreamException(java.lang.String msg) {
super(msg);
}
public XMLStreamException(java.lang.Throwable th) {
super(th);
this.nested = th;
}
public XMLStreamException(java.lang.String msg, java.lang.Throwable th) {
super(msg, th);
this.nested = th;
}
public XMLStreamException(java.lang.String msg, Location location,
java.lang.Throwable th) {
super("ParseError at [row,col]:[" + location.getLineNumber() + ","
+ location.getColumnNumber() + "]\n" + "Message: " + msg, th);
this.location = location;
this.nested = th;
}
public XMLStreamException(java.lang.String msg, Location location) {
super("ParseError at [row,col]:[" + location.getLineNumber() + ","
+ location.getColumnNumber() + "]\n" + "Message: " + msg);
this.location = location;
}
public java.lang.Throwable getNestedException() {
return nested;
}
public Location getLocation() {
return location;
}
}
| 48 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/EventFilter.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 javax.xml.stream;
import javax.xml.stream.events.XMLEvent;
public interface EventFilter {
public boolean accept(XMLEvent event);
} | 49 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/util/StreamReaderDelegate.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 javax.xml.stream.util;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
public class StreamReaderDelegate implements XMLStreamReader {
XMLStreamReader reader;
public StreamReaderDelegate() {
}
public StreamReaderDelegate(XMLStreamReader reader) {
this.reader = reader;
}
public void setParent(XMLStreamReader reader) {
this.reader = reader;
}
public XMLStreamReader getParent() {
return reader;
}
public int next() throws XMLStreamException {
return reader.next();
}
public int nextTag() throws XMLStreamException {
return reader.nextTag();
}
public String getElementText() throws XMLStreamException {
return reader.getElementText();
}
public void require(int type, String namespaceURI, String localName)
throws XMLStreamException {
reader.require(type, namespaceURI, localName);
}
public boolean hasNext() throws XMLStreamException {
return reader.hasNext();
}
public void close() throws XMLStreamException {
reader.close();
}
public String getNamespaceURI(String prefix) {
return reader.getNamespaceURI(prefix);
}
public NamespaceContext getNamespaceContext() {
return reader.getNamespaceContext();
}
public boolean isStartElement() {
return reader.isStartElement();
}
public boolean isEndElement() {
return reader.isEndElement();
}
public boolean isCharacters() {
return reader.isCharacters();
}
public boolean isWhiteSpace() {
return reader.isWhiteSpace();
}
public String getAttributeValue(String namespaceURI, String localName) {
return reader.getAttributeValue(namespaceURI, localName);
}
public int getAttributeCount() {
return reader.getAttributeCount();
}
public QName getAttributeName(int index) {
return reader.getAttributeName(index);
}
public String getAttributePrefix(int index) {
return reader.getAttributePrefix(index);
}
public String getAttributeNamespace(int index) {
return reader.getAttributeNamespace(index);
}
public String getAttributeLocalName(int index) {
return reader.getAttributeLocalName(index);
}
public String getAttributeType(int index) {
return reader.getAttributeType(index);
}
public String getAttributeValue(int index) {
return reader.getAttributeValue(index);
}
public boolean isAttributeSpecified(int index) {
return reader.isAttributeSpecified(index);
}
public int getNamespaceCount() {
return reader.getNamespaceCount();
}
public String getNamespacePrefix(int index) {
return reader.getNamespacePrefix(index);
}
public String getNamespaceURI(int index) {
return reader.getNamespaceURI(index);
}
public int getEventType() {
return reader.getEventType();
}
public String getText() {
return reader.getText();
}
public int getTextCharacters(int sourceStart, char[] target,
int targetStart, int length) throws XMLStreamException {
return reader.getTextCharacters(sourceStart, target, targetStart,
length);
}
public char[] getTextCharacters() {
return reader.getTextCharacters();
}
public int getTextStart() {
return reader.getTextStart();
}
public int getTextLength() {
return reader.getTextLength();
}
public String getEncoding() {
return reader.getEncoding();
}
public boolean hasText() {
return reader.hasText();
}
public Location getLocation() {
return reader.getLocation();
}
public QName getName() {
return reader.getName();
}
public String getLocalName() {
return reader.getLocalName();
}
public boolean hasName() {
return reader.hasName();
}
public String getNamespaceURI() {
return reader.getNamespaceURI();
}
public String getPrefix() {
return reader.getPrefix();
}
public String getVersion() {
return reader.getVersion();
}
public boolean isStandalone() {
return reader.isStandalone();
}
public boolean standaloneSet() {
return reader.standaloneSet();
}
public String getCharacterEncodingScheme() {
return reader.getCharacterEncodingScheme();
}
public String getPITarget() {
return reader.getPITarget();
}
public String getPIData() {
return reader.getPIData();
}
public Object getProperty(String name) throws IllegalArgumentException {
return reader.getProperty(name);
}
}
| 50 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/util/XMLEventAllocator.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 javax.xml.stream.util;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.events.XMLEvent;
public interface XMLEventAllocator {
public XMLEvent allocate(XMLStreamReader reader) throws XMLStreamException;
public void allocate(XMLStreamReader reader, XMLEventConsumer consumer)
throws XMLStreamException;
public XMLEventAllocator newInstance();
}
| 51 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/util/XMLEventConsumer.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 javax.xml.stream.util;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.XMLEvent;
public interface XMLEventConsumer {
public void add(XMLEvent event) throws XMLStreamException;
}
| 52 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/util/EventReaderDelegate.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 javax.xml.stream.util;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.XMLEvent;
public class EventReaderDelegate implements XMLEventReader {
private XMLEventReader reader;
public EventReaderDelegate() {
}
public EventReaderDelegate(XMLEventReader reader) {
this.reader = reader;
}
public void close() throws XMLStreamException {
reader.close();
}
public String getElementText() throws XMLStreamException {
return reader.getElementText();
}
public XMLEventReader getParent() {
return reader;
}
public Object getProperty(java.lang.String name)
throws IllegalArgumentException {
return reader.getProperty(name);
}
public boolean hasNext() {
return reader.hasNext();
}
public Object next() {
return reader.next();
}
public XMLEvent nextEvent() throws XMLStreamException {
return reader.nextEvent();
}
public XMLEvent nextTag() throws XMLStreamException {
return reader.nextTag();
}
public XMLEvent peek() throws XMLStreamException {
return reader.peek();
}
public void remove() {
reader.remove();
}
public void setParent(XMLEventReader reader) {
this.reader = reader;
}
} | 53 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/DTD.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 javax.xml.stream.events;
import java.util.List;
public interface DTD extends XMLEvent {
public String getDocumentTypeDeclaration();
public List getEntities();
public List getNotations();
public Object getProcessedDTD();
} | 54 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/StartDocument.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 javax.xml.stream.events;
public interface StartDocument extends XMLEvent {
public boolean encodingSet();
public String getCharacterEncodingScheme();
public String getSystemId();
public String getVersion();
public boolean isStandalone();
public boolean standaloneSet();
} | 55 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/Namespace.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 javax.xml.stream.events;
public interface Namespace extends Attribute {
public String getNamespaceURI();
public String getPrefix();
public boolean isDefaultNamespaceDeclaration();
} | 56 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/NotationDeclaration.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 javax.xml.stream.events;
public interface NotationDeclaration extends XMLEvent {
public String getName();
public String getPublicId();
public String getSystemId();
} | 57 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/EndElement.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 javax.xml.stream.events;
import java.util.Iterator;
import javax.xml.namespace.QName;
public interface EndElement extends XMLEvent {
public QName getName();
public Iterator getNamespaces();
} | 58 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/StartElement.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 javax.xml.stream.events;
import java.util.Iterator;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
public interface StartElement extends XMLEvent {
public Attribute getAttributeByName(QName name);
public Iterator getAttributes();
public QName getName();
public NamespaceContext getNamespaceContext();
public Iterator getNamespaces();
public String getNamespaceURI(String prefix);
} | 59 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/EntityReference.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 javax.xml.stream.events;
public interface EntityReference extends XMLEvent {
public EntityDeclaration getDeclaration();
public String getName();
} | 60 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/Comment.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 javax.xml.stream.events;
public interface Comment extends XMLEvent {
public String getText();
} | 61 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/Characters.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 javax.xml.stream.events;
public interface Characters extends XMLEvent {
public String getData();
public boolean isCData();
public boolean isIgnorableWhiteSpace();
public boolean isWhiteSpace();
} | 62 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/EndDocument.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 javax.xml.stream.events;
public interface EndDocument extends XMLEvent {
} | 63 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/XMLEvent.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 javax.xml.stream.events;
import java.io.Writer;
import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
public interface XMLEvent extends XMLStreamConstants {
public Characters asCharacters();
public EndElement asEndElement();
public StartElement asStartElement();
public int getEventType();
public Location getLocation();
public QName getSchemaType();
public boolean isAttribute();
public boolean isCharacters();
public boolean isEndDocument();
public boolean isEndElement();
public boolean isEntityReference();
public boolean isNamespace();
public boolean isProcessingInstruction();
public boolean isStartDocument();
public boolean isStartElement();
public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException;
} | 64 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/Attribute.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 javax.xml.stream.events;
import javax.xml.namespace.QName;
public interface Attribute extends XMLEvent {
public String getDTDType();
public QName getName();
public String getValue();
public boolean isSpecified();
} | 65 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/ProcessingInstruction.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 javax.xml.stream.events;
public interface ProcessingInstruction extends XMLEvent {
public String getData();
public String getTarget();
} | 66 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/stream/events/EntityDeclaration.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 javax.xml.stream.events;
public interface EntityDeclaration extends XMLEvent {
public String getBaseURI();
public String getName();
public String getNotationName();
public String getPublicId();
public String getReplacementText();
public String getSystemId();
} | 67 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/namespace/NamespaceContext.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 javax.xml.namespace;
import java.util.Iterator;
public interface NamespaceContext {
public String getNamespaceURI(String prefix);
public String getPrefix(String namespaceURI);
public Iterator getPrefixes(String namespaceURI);
} | 68 |
0 | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml | Create_ds/geronimo-specs/geronimo-stax-api_1.2_spec/src/main/java/javax/xml/namespace/QName.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 javax.xml.namespace;
import java.io.Serializable;
import javax.xml.XMLConstants;
public class QName implements Serializable {
// not specified in the javadoc, but this is what appears to be used.
private static final long serialVersionUID = -9120448754896609940L;
// the namespace URI of this qualified name
private final String namespaceURI;
// the local part of the name
private final String localPart;
// the name prefix string
private final String prefix;
public QName(String localPart) {
// default both the URI and the prefix
this("", localPart, XMLConstants.DEFAULT_NS_PREFIX);
}
public QName(String namespaceURI, String localPart) {
// the default prefix is defined in XMLConstants
this(namespaceURI, localPart, XMLConstants.DEFAULT_NS_PREFIX);
}
public QName(String namespaceURI, String localPart, String prefix) {
// there is a default in constants as well
this.namespaceURI = namespaceURI == null ? "" : namespaceURI;
// both the local part and the prefix are required
if (localPart == null) {
throw new IllegalArgumentException("local part is required when creating a QName");
}
this.localPart = localPart;
if (prefix == null) {
throw new IllegalArgumentException("prefix is required when creating a QName");
}
this.prefix = prefix;
}
public final boolean equals(Object other) {
if (other == null || !(other instanceof QName)) {
return false;
}
QName qName = (QName)other;
// only the namespace and localPart are considered. the prefix is not used.
return namespaceURI.equals(qName.namespaceURI) && localPart.equals(qName.localPart);
}
public final int hashCode() {
// uses both the namespace and localpart as a combined hash.
return namespaceURI.hashCode() ^ localPart.hashCode();
}
public String getNamespaceURI() {
return namespaceURI;
}
public String getLocalPart() {
return localPart;
}
public String getPrefix() {
return prefix;
}
public String toString() {
// if no real URI, this is just the local part, otherwise
// use the braces syntax.
if (namespaceURI.length() == 0) {
return localPart;
}
else {
return "{" + namespaceURI + "}" + localPart;
}
}
public static QName valueOf(String source) {
// a name is required
if (source == null) {
throw new IllegalArgumentException("source QName string is required");
}
// if this is a null string or it does not start with '{', treat this
// as a local part alone.
if (source.length() == 0 || source.charAt(0) != '{') {
return new QName(source);
}
// Namespace URI and local part specified
int uriEnd = source.indexOf('}');
if (uriEnd == -1) {
throw new IllegalArgumentException("Incorrect QName syntax: " + source);
}
String uri = source.substring(1, uriEnd);
if (uri.length() == 0) {
throw new IllegalArgumentException("Null namespace URI in QName value: " + source);
}
// no prefix possible here, just the URI and the local part
return new QName(uri, source.substring(uriEnd + 1));
}
}
| 69 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/Interceptor.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 javax.interceptor;
import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Annotation for used defining the interceptors.
*/
@Retention(RUNTIME)
@Target({TYPE})
@Documented
public @interface Interceptor
{
/**
* A set of default priorities which can be used by
* Interceptors via {@code @javax.annotation.Priority}.
* Interceptors with smaller priority values are called before
* Interceptors with bigger priority numbers.
*/
public static class Priority {
public static final int PLATFORM_BEFORE = 0;
public static final int LIBRARY_BEFORE = 1000;
public static final int APPLICATION = 2000;
public static final int LIBRARY_AFTER = 3000;
public static final int PLATFORM_AFTER = 4000;
private Priority() {
// no-op
}
}
}
| 70 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/InterceptorBinding.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 javax.interceptor;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Defines bindings for interceptors.
*
* @version $Rev$ $Id: InterceptorBindingType.java 782259 2009-06-06 13:31:32Z gerdogdu $
*/
@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)
@Documented
public @interface InterceptorBinding
{
}
| 71 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/AroundTimeout.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import static java.lang.annotation.ElementType.METHOD;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
/**
* @version $Revision$ $Date$
*/
@Target(value = {METHOD})
@Retention(value = RUNTIME)
public @interface AroundTimeout {
}
| 72 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/AroundInvoke.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface AroundInvoke {
}
| 73 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/ExcludeClassInterceptors.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
*/
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcludeClassInterceptors {
}
| 74 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/InvocationContext.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Map;
/**
* @version $Rev$ $Date$
*/
public interface InvocationContext {
Object getTarget();
Method getMethod();
Constructor<?> getConstructor();
Object[] getParameters();
void setParameters(Object[] parameters);
Map<String,Object> getContextData();
Object proceed() throws Exception;
Object getTimer();
}
| 75 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/AroundConstruct.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface AroundConstruct {
}
| 76 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/Interceptors.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
*/
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
public @interface Interceptors {
Class[] value();
}
| 77 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.2_spec/src/main/java/javax/interceptor/ExcludeDefaultInterceptors.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
*/
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcludeDefaultInterceptors {
}
| 78 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax/interceptor/Interceptor.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 javax.interceptor;
import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Annotation for used defining the interceptors.
*
* @version $Rev$ $Id: Interceptor.java 782259 2009-06-06 13:31:32Z gerdogdu $
*/
@Retention(RUNTIME)
@Target({TYPE})
@Documented
public @interface Interceptor
{
}
| 79 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax/interceptor/InterceptorBinding.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 javax.interceptor;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Defines bindings for interceptors.
*
* @version $Rev$ $Id: InterceptorBindingType.java 782259 2009-06-06 13:31:32Z gerdogdu $
*/
@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)
@Documented
public @interface InterceptorBinding
{
}
| 80 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax/interceptor/AroundTimeout.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import static java.lang.annotation.ElementType.METHOD;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
/**
* @version $Revision$ $Date$
*/
@Target(value = {METHOD})
@Retention(value = RUNTIME)
public @interface AroundTimeout {
}
| 81 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax/interceptor/AroundInvoke.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface AroundInvoke {
}
| 82 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax/interceptor/ExcludeClassInterceptors.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcludeClassInterceptors {
}
| 83 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax/interceptor/InvocationContext.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.reflect.Method;
/**
* @version $Rev$ $Date$
*/
public interface InvocationContext {
public Object getTarget();
public Method getMethod();
public Object[] getParameters();
public void setParameters(Object[] parameters);
public java.util.Map<String,Object> getContextData();
public Object proceed() throws Exception;
public Object getTimer();
}
| 84 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax/interceptor/Interceptors.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Interceptors {
Class[] value();
}
| 85 |
0 | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-interceptor_1.1_spec/src/main/java/javax/interceptor/ExcludeDefaultInterceptors.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.
*/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
/**
* @version $Rev$ $Date$
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcludeDefaultInterceptors {
}
| 86 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/decorator/Decorator.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 javax.decorator;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.enterprise.inject.Stereotype;
/**
* Defines decorator classes.
* Classes annotated with @Decorator will get picked up by the CDI container and
* 'decorate' the implemented CDI ManagedBeans.
*
* A Decorator must implement at least one of the Interfaces of it's decorated type.
*
*
* @version $Rev$ $Date$
*
*/
@Target(value = ElementType.TYPE)
@Retention(value = RetentionPolicy.RUNTIME)
@Documented
@Stereotype
public @interface Decorator
{
} | 87 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/decorator/Delegate.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 javax.decorator;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Defines a delegation point in a {@see Decorator}.
* There must only be one delegation point in a Decorator.
*
* @see javax.decorator.Decorator
*
* @version $Rev$ $Date$
*/
@Target({FIELD,PARAMETER})
@Retention(RUNTIME)
@Documented
public @interface Delegate
{
}
| 88 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/ConversationScoped.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 javax.enterprise.context;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Conversation scope type.
*
* @see Conversation
*/
@Target( { ElementType.TYPE, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@NormalScope(passivating = true)
@Inherited
public @interface ConversationScoped
{
}
| 89 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/ContextException.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 javax.enterprise.context;
/**
* Base class for all CDI problems related to {@link javax.enterprise.context.spi.Context}s.
*/
public class ContextException extends RuntimeException
{
private static final long serialVersionUID = -3599813072560026919L;
public ContextException()
{
}
public ContextException(String message)
{
super(message);
}
public ContextException(String message, Throwable cause)
{
super(message, cause);
}
public ContextException(Throwable cause)
{
super(cause);
}
}
| 90 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/ContextNotActiveException.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 javax.enterprise.context;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
/**
* This Exception is thrown if
* {@link Context#get(javax.enterprise.context.spi.Contextual)} or
* {@link Context#get(javax.enterprise.context.spi.Contextual, javax.enterprise.context.spi.CreationalContext)}
* is called on a Context which is not 'active' in respect to the current thread.
* This ultimately also happens if a CDI scoped Contextual Reference (the CDI proxy for a Contextual Instance)
* of a CDI bean gets accessed in situations where it's Context is not available.
*
* An example of such a case would be calling a method on a @SessionScoped CDI bean in a situation where
* we do not have an active session like e.g. during an @Asynchronous EJB method.
*
* @see Context#get(Contextual, CreationalContext)
* @see Context#get(Contextual)
*/
public class ContextNotActiveException extends ContextException
{
private static final long serialVersionUID = -3599813072560026919L;
public ContextNotActiveException()
{
}
/**
* Creates a new exception with message.
*
* @param message message
*/
public ContextNotActiveException(String message)
{
super(message);
}
/**
* Create a new exception with the root cause.
*
* @param cause cause of the exception
*/
public ContextNotActiveException(Throwable cause)
{
super(cause);
}
/**
* Creates a new exception with the given message and throwable cause.
*
* @param message exception message
* @param cause root cause of the exception
*/
public ContextNotActiveException(String message, Throwable cause)
{
super(message, cause);
}
}
| 91 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/Destroyed.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 javax.enterprise.context;
import javax.inject.Qualifier;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Qualifier for events which get fired when a Context ends.
* The exact point is before the contextual instances of that Context
* actually get destroyed.
*
* Extensions should use a reasonable event object.
* For built-in scopes the following event-classes will be used
* <ul>
* <li>@RequestScoped: the ServletRequest for web requests, any other Object for other 'requests'</li>
* <li>@SessionScoped: the HttpSession</li>
* <li>@ApplicationScoped: ServletContext for web apps, any other Object for other apps</li>
* <li>@ConversationScoped: ServletRequest if handled during a web request, or any other Object for </li>
* </ul>
*
* @see javax.enterprise.context.Initialized
* @since 1.1
*/
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface Destroyed
{
/**
* @return the Scope annotation this is for.
*/
Class<? extends Annotation> value();
}
| 92 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/BusyConversationException.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 javax.enterprise.context;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
/**
* A long running conversation must only be used by one request at the same time!
*
* If a parallel access to a long running conversation gets detected, this very Exception will
* be thrown for the new request and the 2nd request will get a
* fresh Conversation assigned.
*
* The customer application may decide to catch this Exception and continue it's work
* with the new conversation.
*
* @see Context#get(Contextual, CreationalContext)
* @see Context#get(Contextual)
* @since 1.0 PFD2
*/
public class BusyConversationException extends ContextException
{
private static final long serialVersionUID = -3599813072560026919L ;
public BusyConversationException()
{
}
/**
* Creates a new exception with message.
*
* @param message message
*/
public BusyConversationException(String message)
{
super(message);
}
/**
* Create a new exception with the root cause.
*
* @param cause cause of the exception
*/
public BusyConversationException(Throwable cause)
{
super(cause);
}
/**
* Creates a new exception with the given message and throwable cause.
*
* @param message exception message
* @param cause root cause of the exception
*/
public BusyConversationException(String message, Throwable cause)
{
super(message, cause);
}
}
| 93 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/NonexistentConversationException.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 javax.enterprise.context;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
/**
* If a long running conversation cannot be restored, OWB will
* assign a fresh conversation and throws this very Exception.
*
* The user code is free to catch it and continue his work
* with this new conversation.
*
* @see Context#get(Contextual, CreationalContext)
* @see Context#get(Contextual)
* @since 1.0 PFD2
*/
public class NonexistentConversationException extends ContextException
{
private static final long serialVersionUID = -3599813072560026919L;
public NonexistentConversationException()
{
}
/**
* Creates a new exception with message.
*
* @param message message
*/
public NonexistentConversationException(String message)
{
super(message);
}
/**
* Create a new exception with the root cause.
*
* @param cause cause of the exception
*/
public NonexistentConversationException(Throwable cause)
{
super(cause);
}
/**
* Creates a new exception with the given message and throwable cause.
*
* @param message exception message
* @param cause root cause of the exception
*/
public NonexistentConversationException(String message, Throwable cause)
{
super(message, cause);
}
}
| 94 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/NormalScope.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 javax.enterprise.context;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* <p>Defines CDI scopes which have a well-defined lifecycle. Examples for such scopes
* are {@link javax.enterprise.context.RequestScoped}, {@link javax.enterprise.context.SessionScoped}
* and {@link javax.enterprise.context.ApplicationScoped}.</p>
* <p>Beans of such a scope will get a normalscoping proxy (Contextual Reference)
* for every injection.</p>
*
* <p>If a NormalScope is {@code passivating} then all it's Contextual Instances need
* to implement {@code java.io.Serializable}.</p>
* @version $Rev$ $Date$
*
*/
@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)
@Documented
public @interface NormalScope
{
/**Defines passivation semantic*/
boolean passivating() default false;
}
| 95 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/ApplicationScoped.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 javax.enterprise.context;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Defines the application scoped type.
*
* <p>
* Please see the <b>8.5.3 Application context lifecycle</b>
* of the specification.
* </p>
*/
@NormalScope
@Target( { ElementType.TYPE, ElementType.METHOD , ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface ApplicationScoped
{
}
| 96 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/Conversation.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 javax.enterprise.context;
/**
* Defines the conversation instance contract for using
* in the {@link ConversationScoped} webbeans components.
*
* <p>
* Please see the <b>8.5.4 Conversation context lifecycle</b> of the specification.
* </p>
*
* @see ConversationScoped
*/
public interface Conversation
{
/**
* Starts new conversation.
*/
public void begin();
/**
* Starts new conversation with the given id.
*
* @param id conversation id.
*/
public void begin(String id);
/**
* Ends of the conversation.
*/
public void end();
/**
* @return <code>true</code> if conversation is transient,
* <code>false</code> if it is a long running conversation.
*/
public boolean isTransient();
/**
* Gets conversation id.
*
* @return conversation id
*/
public String getId();
/**
* Returns conversation time out.
*
* @return conversation timeout
*/
public long getTimeout();
/**
* Sets conversation timeout in ms.
*
* @param milliseconds timeout of the conversation
*/
public void setTimeout(long milliseconds);
}
| 97 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/Dependent.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 javax.enterprise.context;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.inject.Scope;
/**
* <p>An @#064;Dependent scoped Contextual instance shares it's lifecycle with
* the Contextual Instance it got injected to.
* @Dependent scoped Contextual Instances also do <strong>not</strong> get
* a normalscoping-proxy (Contextual Reference). They only get a proxy
* if they are either intercepted or decorated.</p>
*
* <p>As of CDI-1.0 this is the default scope for any class if no other
* scope is explicitly annotated. Since CDI-1.1 this is only the case if the
* beans.xml has a {@code bean-discovery-mode="all"}</p>
*
* <p>
* Every CDI instance has an associated dependent context. Each dependent context
* is destroyed with its parent webbeans component instance.
* </p>
*
* <p>
* Please see <b>8.3 Dependent pseudo-scope</b> of the specification
* for further information.
* </p>
*
*/
@Scope
@Target( { ElementType.METHOD, ElementType.TYPE, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface Dependent
{
}
| 98 |
0 | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise | Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/SessionScoped.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 javax.enterprise.context;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Session scoped.
* @version $Rev$ $Date$
*
*/
@Target( { TYPE, METHOD, FIELD})
@Retention(RUNTIME)
@Documented
@NormalScope(passivating=true)
@Inherited
public @interface SessionScoped
{
}
| 99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.