You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/06/14 23:14:49 UTC
svn commit: r190657 [10/23] - in /incubator/beehive/trunk/system-controls:
./ ant/ samples/ejb/
samples/ejb/client/org/apache/beehive/controls/system/ejb/sample/client/
samples/ejb/control/org/apache/beehive/controls/system/ejb/sample/control/
samples/ejb/ejb/META-INF/
samples/ejb/ejb/org/apache/beehive/controls/system/ejb/sample/bean/
samples/jdbc/jdbcControlSample/ samples/jdbc/jdbcControlSample/META-INF/
samples/jdbc/jdbcControlSample/WEB-INF/
samples/jdbc/jdbcControlSample/WEB-INF/src/
samples/jdbc/jdbcControlSample/WEB-INF/src/controls/
samples/jdbc/jdbcControlSample/WEB-INF/src/servlet/
samples/jdbc/jdbcControlSample/WEB-INF/src/shared/ samples/jms/
samples/jms/src/org/apache/beehive/controls/system/jms/samples/
samples/webservice/amazon/ samples/webservice/amazon/junit/
samples/webservice/amazon/schemas/ samples/webservice/common/src/test/
samples/webservice/google/ samples/webservice/google/junit/model/
samples/webservice/google/rpc_schemas/ samples/webservice/google/servlet/
samples/webservice/wsm_samples_client/
samples/webservice/wsm_samples_client/junit/
samples/webservice/wsm_samples_client/junit/org/wsm/samples/client/header/
samples/webservice/wsm_samples_client/junit/org/wsm/samples/client/webparam/
samples/webservice/xmlbeans/ samples/webservice/xmlbeans/junit/ src/ejb/
src/ejb/org/apache/beehive/controls/system/ejb/ src/ejb/schema/ src/jdbc/
src/jdbc/org/apache/beehive/controls/system/jdbc/
src/jdbc/org/apache/beehive/controls/system/jdbc/parser/ src/jms/
src/jms/org/apache/beehive/controls/system/jms/
src/jms/org/apache/beehive/controls/system/jms/impl/
src/jms/org/apache/beehive/controls/system/jndi/
src/jms/org/apache/beehive/controls/system/jndi/impl/ src/webservice/
src/webservice/org/apache/beehive/controls/system/webservice/
src/webservice/org/apache/beehive/controls/system/webservice/generator/
src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/
src/webservice/org/apache/beehive/controls/system/webservice/utils/
test/ant/ test/conf/ test/src/jdbc/controls/
test/src/jdbc/controls/org/apache/beehive/controls/system/jdbc/test/dbconnection/
test/src/jdbc/controls/org/apache/beehive/controls/system/jdbc/test/errors/
test/src/jdbc/controls/org/apache/beehive/controls/system/jdbc/test/results/
test/src/jdbc/controls/schemas/badusers/
test/src/jdbc/controls/schemas/users/ test/src/jdbc/jdbc-container/
test/src/jdbc/jdbc-container/application/
test/src/jdbc/jdbc-container/src/org/apache/beehive/controls/system/jdbc/containertest/
test/src/jdbc/jdbc-container/webapp/WEB-INF/
test/src/jdbc/jdbc-container/webapp/conf/Catalina/localhost/
test/src/jdbc/junitTests/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/dbconnection/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/errors/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/results/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/sqlparser/
test/src/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/utils/
test/src/webservice/ test/src/webservice/jcxgen-tests/
test/src/webservice/jcxgen-tests/tests/org/apache/beehive/controls/system/webservice/units/jcxgen/
test/src/webservice/schemas/ test/src/webservice/servers/webapp/WEB-INF/
test/src/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/doclitwrap/
test/src/webservice/servers/webapp/WEB-INF/src/web/
test/src/webservice/servers/webapp/WEB-INF/webservices/web/complex/
test/src/webservice/tests/org/apache/beehive/controls/system/webservice/units/dlwservice/
Propchange: incubator/beehive/trunk/system-controls/src/ejb/schema/j2ee_1_4.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/src/ejb/schema/j2ee_web_services_client_1_1.xsd
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/ejb/schema/j2ee_web_services_client_1_1.xsd?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/ejb/schema/j2ee_web_services_client_1_1.xsd (original)
+++ incubator/beehive/trunk/system-controls/src/ejb/schema/j2ee_web_services_client_1_1.xsd Tue Jun 14 14:14:42 2005
@@ -1,343 +1,343 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.1">
- <xsd:annotation>
- <xsd:documentation>
- @(#)j2ee_web_services_client_1_1.xsds 1.10 02/11/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2002 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:annotation>
- <xsd:documentation>
-
- (C) Copyright International Business Machines Corporation 2002
-
- </xsd:documentation>
- </xsd:annotation>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-component-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-ref element declares a client dependency
- on the container for resolving a Service Endpoint Interface
- to a WSDL port. It optionally associates the Service Endpoint
- Interface with a particular port-component. This is only used
- by the container for a Service.getPort(Class) method call.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="service-endpoint-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint-interface element defines a fully qualified
- Java class that represents the Service Endpoint Interface of a
- WSDL port.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-component-link"
- type="j2ee:string"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-link element links a port-component-ref
- to a specific port-component required to be made available
- by a service reference.
-
- The value of a port-component-link must be the
- port-component-name of a port-component in the same module
- or another module in the same application unit. The syntax
- for specification follows the syntax defined for ejb-link
- in the EJB 2.0 specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:group name="service-refGroup">
- <xsd:sequence>
- <xsd:element name="service-ref"
- type="j2ee:service-refType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:key name="service-ref_handler-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:handler"/>
- <xsd:field xpath="j2ee:handler-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
- </xsd:group>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref element declares a reference to a Web
- service. It contains optional description, display name and
- icons, a declaration of the required Service interface,
- an optional WSDL document location, an optional set
- of JAX-RPC mappings, an optional QName for the service element,
- an optional set of Service Endpoint Interfaces to be resolved
- by the container to a WSDL port, and an optional set of handlers.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="service-ref-name"
- type="j2ee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref-name element declares logical name that the
- components in the module use to look up the Web service. It
- is recommended that all service reference names start with
- "service/".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="service-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-interface element declares the fully qualified class
- name of the JAX-RPC Service interface the client depends on.
- In most cases the value will be javax.xml.rpc.Service. A JAX-RPC
- generated Service Interface class may also be specified.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="wsdl-file"
- type="j2ee:xsdAnyURIType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-file element contains the URI location of a WSDL
- file. The location is relative to the root of the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="jaxrpc-mapping-file"
- type="j2ee:pathType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The jaxrpc-mapping-file element contains the name of a file that
- describes the JAX-RPC mapping between the Java interaces used by
- the application and the WSDL description in the wsdl-file. The
- file name is a relative path within the module file.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="service-qname"
- type="j2ee:xsdQNameType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-qname element declares the specific WSDL service
- element that is being refered to. It is not specified if no
- wsdl-file is declared.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-component-ref"
- type="j2ee:port-component-refType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-ref element declares a client dependency
- on the container for resolving a Service Endpoint Interface
- to a WSDL port. It optionally associates the Service Endpoint
- Interface with a particular port-component. This is only used
- by the container for a Service.getPort(Class) method call.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="handler"
- type="j2ee:service-ref_handlerType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can
- access the init-param name/value pairs using the
- HandlerInfo interface. If port-name is not specified, the
- handler is assumed to be associated with all ports of the
- service.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-ref_handlerType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can access the
- init-param name/value pairs using the HandlerInfo interface. If
- port-name is not specified, the handler is assumed to be associated
- with all ports of the service.
-
- Used in: service-ref
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="handler-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a fully qualified class name for the handler
- implementation.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="init-param"
- type="j2ee:param-valueType"
- minOccurs="0" maxOccurs="unbounded"/>
-
- <xsd:element name="soap-header"
- type="j2ee:xsdQNameType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the QName of a SOAP header that will be processed
- by the handler.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="soap-role"
- type="j2ee:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The soap-role element contains a SOAP actor definition that
- the Handler will play as a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-name"
- type="j2ee:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-name element defines the WSDL port-name that a
- handler should be associated with.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://java.sun.com/xml/ns/j2ee"
+ xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.1">
+ <xsd:annotation>
+ <xsd:documentation>
+ @(#)j2ee_web_services_client_1_1.xsds 1.10 02/11/03
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Copyright 2002 Sun Microsystems, Inc., 901 San Antonio
+ Road, Palo Alto, California 94303, U.S.A. All rights
+ reserved.
+
+ Sun Microsystems, Inc. has intellectual property rights
+ relating to technology described in this document. In
+ particular, and without limitation, these intellectual
+ property rights may include one or more of the U.S. patents
+ listed at http://www.sun.com/patents and one or more
+ additional patents or pending patent applications in the
+ U.S. and other countries.
+
+ This document and the technology which it describes are
+ distributed under licenses restricting their use, copying,
+ distribution, and decompilation. No part of this document
+ may be reproduced in any form by any means without prior
+ written authorization of Sun and its licensors, if any.
+
+ Third-party software, including font technology, is
+ copyrighted and licensed from Sun suppliers.
+
+ Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+ JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+ Cup logo are trademarks or registered trademarks of Sun
+ Microsystems, Inc. in the U.S. and other countries.
+
+ Federal Acquisitions: Commercial Software - Government Users
+ Subject to Standard License Terms and Conditions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:annotation>
+ <xsd:documentation>
+
+ (C) Copyright International Business Machines Corporation 2002
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="port-component-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-component-ref element declares a client dependency
+ on the container for resolving a Service Endpoint Interface
+ to a WSDL port. It optionally associates the Service Endpoint
+ Interface with a particular port-component. This is only used
+ by the container for a Service.getPort(Class) method call.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="service-endpoint-interface"
+ type="j2ee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-endpoint-interface element defines a fully qualified
+ Java class that represents the Service Endpoint Interface of a
+ WSDL port.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="port-component-link"
+ type="j2ee:string"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-component-link element links a port-component-ref
+ to a specific port-component required to be made available
+ by a service reference.
+
+ The value of a port-component-link must be the
+ port-component-name of a port-component in the same module
+ or another module in the same application unit. The syntax
+ for specification follows the syntax defined for ejb-link
+ in the EJB 2.0 specification.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:group name="service-refGroup">
+ <xsd:sequence>
+ <xsd:element name="service-ref"
+ type="j2ee:service-refType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:key name="service-ref_handler-name-key">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the name of the handler. The name must be unique
+ within the module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:selector xpath="j2ee:handler"/>
+ <xsd:field xpath="j2ee:handler-name"/>
+ </xsd:key>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:group>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="service-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-ref element declares a reference to a Web
+ service. It contains optional description, display name and
+ icons, a declaration of the required Service interface,
+ an optional WSDL document location, an optional set
+ of JAX-RPC mappings, an optional QName for the service element,
+ an optional set of Service Endpoint Interfaces to be resolved
+ by the container to a WSDL port, and an optional set of handlers.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="j2ee:descriptionGroup"/>
+ <xsd:element name="service-ref-name"
+ type="j2ee:jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-ref-name element declares logical name that the
+ components in the module use to look up the Web service. It
+ is recommended that all service reference names start with
+ "service/".
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="service-interface"
+ type="j2ee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-interface element declares the fully qualified class
+ name of the JAX-RPC Service interface the client depends on.
+ In most cases the value will be javax.xml.rpc.Service. A JAX-RPC
+ generated Service Interface class may also be specified.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="wsdl-file"
+ type="j2ee:xsdAnyURIType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The wsdl-file element contains the URI location of a WSDL
+ file. The location is relative to the root of the module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="jaxrpc-mapping-file"
+ type="j2ee:pathType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The jaxrpc-mapping-file element contains the name of a file that
+ describes the JAX-RPC mapping between the Java interaces used by
+ the application and the WSDL description in the wsdl-file. The
+ file name is a relative path within the module file.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="service-qname"
+ type="j2ee:xsdQNameType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-qname element declares the specific WSDL service
+ element that is being refered to. It is not specified if no
+ wsdl-file is declared.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="port-component-ref"
+ type="j2ee:port-component-refType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-component-ref element declares a client dependency
+ on the container for resolving a Service Endpoint Interface
+ to a WSDL port. It optionally associates the Service Endpoint
+ Interface with a particular port-component. This is only used
+ by the container for a Service.getPort(Class) method call.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="handler"
+ type="j2ee:service-ref_handlerType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Declares the handler for a port-component. Handlers can
+ access the init-param name/value pairs using the
+ HandlerInfo interface. If port-name is not specified, the
+ handler is assumed to be associated with all ports of the
+ service.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="service-ref_handlerType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Declares the handler for a port-component. Handlers can access the
+ init-param name/value pairs using the HandlerInfo interface. If
+ port-name is not specified, the handler is assumed to be associated
+ with all ports of the service.
+
+ Used in: service-ref
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="j2ee:descriptionGroup"/>
+ <xsd:element name="handler-name"
+ type="j2ee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the name of the handler. The name must be unique
+ within the module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="handler-class"
+ type="j2ee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines a fully qualified class name for the handler
+ implementation.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="init-param"
+ type="j2ee:param-valueType"
+ minOccurs="0" maxOccurs="unbounded"/>
+
+ <xsd:element name="soap-header"
+ type="j2ee:xsdQNameType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the QName of a SOAP header that will be processed
+ by the handler.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="soap-role"
+ type="j2ee:string"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The soap-role element contains a SOAP actor definition that
+ the Handler will play as a role.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="port-name"
+ type="j2ee:string"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-name element defines the WSDL port-name that a
+ handler should be associated with.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+</xsd:schema>
+
Propchange: incubator/beehive/trunk/system-controls/src/ejb/schema/j2ee_web_services_client_1_1.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/src/ejb/schema/jsp_2_0.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/src/ejb/schema/web-app_2_4.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultIteratorResultSetMapper.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultIteratorResultSetMapper.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultIteratorResultSetMapper.java (original)
+++ incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultIteratorResultSetMapper.java Tue Jun 14 14:14:42 2005
@@ -1,52 +1,52 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed 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.
- *
- * $Header:$
- */
-
-package org.apache.beehive.controls.system.jdbc;
-
-import org.apache.beehive.controls.api.context.ControlBeanContext;
-
-import java.lang.reflect.Method;
-import java.sql.ResultSet;
-import java.util.Calendar;
-import java.util.Iterator;
-
-/**
- * Default ResultSetMapper implementation for Iterators.
- */
-public class DefaultIteratorResultSetMapper extends ResultSetMapper {
-
- /**
- * Map a ResultSet to an object type
- * Type of object to interate over is defined in the SQL annotation for the method.
- *
- * @param context A ControlBeanContext instance, see Beehive controls javadoc for additional information
- * @param m Method assoicated with this call.
- * @param resultSet Result set to map.
- * @param cal A Calendar instance for time/date value resolution.
- * @return The Iterator object instance resulting from the ResultSet
- */
- public Iterator mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
- return new ResultSetIterator(context, m, resultSet, cal);
- }
-
- /**
- * Can the ResultSet which this mapper uses be closed by the database control on return from its invoke() method?
- * @return always returns false
- */
- public boolean canCloseResultSet() { return false; }
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.system.jdbc;
+
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+
+import java.lang.reflect.Method;
+import java.sql.ResultSet;
+import java.util.Calendar;
+import java.util.Iterator;
+
+/**
+ * Default ResultSetMapper implementation for Iterators.
+ */
+public class DefaultIteratorResultSetMapper extends ResultSetMapper {
+
+ /**
+ * Map a ResultSet to an object type
+ * Type of object to interate over is defined in the SQL annotation for the method.
+ *
+ * @param context A ControlBeanContext instance, see Beehive controls javadoc for additional information
+ * @param m Method assoicated with this call.
+ * @param resultSet Result set to map.
+ * @param cal A Calendar instance for time/date value resolution.
+ * @return The Iterator object instance resulting from the ResultSet
+ */
+ public Iterator mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
+ return new ResultSetIterator(context, m, resultSet, cal);
+ }
+
+ /**
+ * Can the ResultSet which this mapper uses be closed by the database control on return from its invoke() method?
+ * @return always returns false
+ */
+ public boolean canCloseResultSet() { return false; }
+}
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultIteratorResultSetMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultJndiContextFactory.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultJndiContextFactory.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultJndiContextFactory.java (original)
+++ incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultJndiContextFactory.java Tue Jun 14 14:14:42 2005
@@ -1,39 +1,39 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed 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.
- *
- * $Header:$
- */
-
-package org.apache.beehive.controls.system.jdbc;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.Context;
-
-/**
- * Default context factory implementation.
- * May be overridden in class's ConnectionDataSource annotation.
- */
-class DefaultJndiContextFactory extends JdbcControl.JndiContextFactory {
-
- /**
- * Return a Jndi InitialContext
- * @return InitialContext instance
- * @throws NamingException on error.
- */
- public Context getContext() throws NamingException {
- return (Context) new InitialContext();
- }
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.system.jdbc;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.Context;
+
+/**
+ * Default context factory implementation.
+ * May be overridden in class's ConnectionDataSource annotation.
+ */
+class DefaultJndiContextFactory extends JdbcControl.JndiContextFactory {
+
+ /**
+ * Return a Jndi InitialContext
+ * @return InitialContext instance
+ * @throws NamingException on error.
+ */
+ public Context getContext() throws NamingException {
+ return (Context) new InitialContext();
+ }
+}
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultJndiContextFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultObjectResultSetMapper.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultObjectResultSetMapper.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultObjectResultSetMapper.java (original)
+++ incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultObjectResultSetMapper.java Tue Jun 14 14:14:42 2005
@@ -1,117 +1,117 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed 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.
- *
- * $Header:$
- */
-
-package org.apache.beehive.controls.system.jdbc;
-
-import org.apache.beehive.controls.api.ControlException;
-import org.apache.beehive.controls.api.context.ControlBeanContext;
-import org.apache.beehive.controls.system.jdbc.JdbcControl.SQL;
-
-import java.lang.reflect.Method;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Calendar;
-
-/**
- * Default ResultSetMapper implementation for Objects.
- */
-public class DefaultObjectResultSetMapper extends ResultSetMapper {
-
- /**
- * static reference to the TypeMappingsFactory for this class
- */
- protected static final TypeMappingsFactory _tmf = TypeMappingsFactory.getInstance();
-
- /**
- * Map the ResultSet to the method's return type. The object type returned is defined by the return type of the method.
- *
- * @param context A ControlBeanContext instance, see Beehive controls javadoc for additional information
- * @param m Method assoicated with this call.
- * @param resultSet Result set to map.
- * @param cal A Calendar instance for time/date value resolution.
- * @return The Object resulting from the ResultSet
- */
- public Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
-
- final Class returnType = m.getReturnType();
- final boolean isArray = returnType.isArray();
-
- try {
- if (isArray) {
- final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
- return arrayFromResultSet(resultSet, methodSQL.arrayMaxLength(), returnType, cal);
- } else {
- if (!resultSet.next()) {
- return _tmf.fixNull(m.getReturnType());
- }
- return RowMapperFactory.getRowMapper(resultSet, returnType, cal).mapRowToReturnType();
- }
- } catch (SQLException e) {
- throw new ControlException(e.getMessage(), e);
- }
- }
-
- //
- // ////////////////////////////////// PRIVATE METHODS //////////////////////////////////////////
- //
-
- /**
- * Invoked when the return type of the method is an array type.
- *
- * @param rs ResultSet to process.
- * @param maxRows The maximum size of array to create
- * @param arrayClass The class of object contained within the array
- * @param cal A calendar instance to use for date/time values
- * @return An array of the specified class type
- * @throws SQLException On error.
- */
- protected Object arrayFromResultSet(ResultSet rs, int maxRows, Class arrayClass, Calendar cal)
- throws SQLException {
-
- Class componentType = arrayClass.getComponentType();
- ResultSetMetaData md = rs.getMetaData();
-
- ArrayList<Object> list = new ArrayList<Object>();
- int numRows;
-
- boolean hasMoreRows = rs.next();
- RowMapper rowMapper = RowMapperFactory.getRowMapper(rs, componentType, cal);
-
- for (numRows = 0; numRows != maxRows && hasMoreRows; numRows++) {
- list.add(rowMapper.mapRowToReturnType());
- hasMoreRows = rs.next();
- }
-
- Object array = java.lang.reflect.Array.newInstance(componentType, numRows);
- try {
- for (int i = 0; i < numRows; i++) {
- java.lang.reflect.Array.set(array, i, list.get(i));
- }
- } catch (IllegalArgumentException iae) {
- // assuming no errors in resultSetObject() this can only happen
- // for single column result sets.
- throw new ControlException("The declared Java type for array " + componentType.getName()
- + "is incompatible with the SQL format of column " + md.getColumnName(1)
- + md.getColumnTypeName(1) + "which returns objects of type + "
- + list.get(0).getClass().getName());
- }
- return array;
- }
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.system.jdbc;
+
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.system.jdbc.JdbcControl.SQL;
+
+import java.lang.reflect.Method;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Calendar;
+
+/**
+ * Default ResultSetMapper implementation for Objects.
+ */
+public class DefaultObjectResultSetMapper extends ResultSetMapper {
+
+ /**
+ * static reference to the TypeMappingsFactory for this class
+ */
+ protected static final TypeMappingsFactory _tmf = TypeMappingsFactory.getInstance();
+
+ /**
+ * Map the ResultSet to the method's return type. The object type returned is defined by the return type of the method.
+ *
+ * @param context A ControlBeanContext instance, see Beehive controls javadoc for additional information
+ * @param m Method assoicated with this call.
+ * @param resultSet Result set to map.
+ * @param cal A Calendar instance for time/date value resolution.
+ * @return The Object resulting from the ResultSet
+ */
+ public Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
+
+ final Class returnType = m.getReturnType();
+ final boolean isArray = returnType.isArray();
+
+ try {
+ if (isArray) {
+ final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
+ return arrayFromResultSet(resultSet, methodSQL.arrayMaxLength(), returnType, cal);
+ } else {
+ if (!resultSet.next()) {
+ return _tmf.fixNull(m.getReturnType());
+ }
+ return RowMapperFactory.getRowMapper(resultSet, returnType, cal).mapRowToReturnType();
+ }
+ } catch (SQLException e) {
+ throw new ControlException(e.getMessage(), e);
+ }
+ }
+
+ //
+ // ////////////////////////////////// PRIVATE METHODS //////////////////////////////////////////
+ //
+
+ /**
+ * Invoked when the return type of the method is an array type.
+ *
+ * @param rs ResultSet to process.
+ * @param maxRows The maximum size of array to create
+ * @param arrayClass The class of object contained within the array
+ * @param cal A calendar instance to use for date/time values
+ * @return An array of the specified class type
+ * @throws SQLException On error.
+ */
+ protected Object arrayFromResultSet(ResultSet rs, int maxRows, Class arrayClass, Calendar cal)
+ throws SQLException {
+
+ Class componentType = arrayClass.getComponentType();
+ ResultSetMetaData md = rs.getMetaData();
+
+ ArrayList<Object> list = new ArrayList<Object>();
+ int numRows;
+
+ boolean hasMoreRows = rs.next();
+ RowMapper rowMapper = RowMapperFactory.getRowMapper(rs, componentType, cal);
+
+ for (numRows = 0; numRows != maxRows && hasMoreRows; numRows++) {
+ list.add(rowMapper.mapRowToReturnType());
+ hasMoreRows = rs.next();
+ }
+
+ Object array = java.lang.reflect.Array.newInstance(componentType, numRows);
+ try {
+ for (int i = 0; i < numRows; i++) {
+ java.lang.reflect.Array.set(array, i, list.get(i));
+ }
+ } catch (IllegalArgumentException iae) {
+ // assuming no errors in resultSetObject() this can only happen
+ // for single column result sets.
+ throw new ControlException("The declared Java type for array " + componentType.getName()
+ + "is incompatible with the SQL format of column " + md.getColumnName(1)
+ + md.getColumnTypeName(1) + "which returns objects of type + "
+ + list.get(0).getClass().getName());
+ }
+ return array;
+ }
+}
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultObjectResultSetMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultResultSetMapper.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultResultSetMapper.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultResultSetMapper.java (original)
+++ incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultResultSetMapper.java Tue Jun 14 14:14:42 2005
@@ -1,50 +1,50 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed 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.
- *
- * $Header:$
- */
-
-package org.apache.beehive.controls.system.jdbc;
-
-import org.apache.beehive.controls.api.context.ControlBeanContext;
-
-import java.lang.reflect.Method;
-import java.sql.ResultSet;
-import java.util.Calendar;
-
-/**
- * Default ResultSetMapper implementation for ResultSets.
- */
-public class DefaultResultSetMapper extends ResultSetMapper {
-
- /**
- * Maps a ResultSet to a ResultSet. The default implementation is a NOOP.
- *
- * @param context A ControlBeanContext instance.
- * @param m Method assoicated with this call.
- * @param resultSet Result set to map.
- * @param cal A Calendar instance for resolving date/time values.
- * @return An object.
- */
- public Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
- return resultSet;
- }
-
- /**
- * Can the ResultSet which this mapper uses be closed by the database control?
- * @return always false
- */
- public boolean canCloseResultSet() { return false; }
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.system.jdbc;
+
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+
+import java.lang.reflect.Method;
+import java.sql.ResultSet;
+import java.util.Calendar;
+
+/**
+ * Default ResultSetMapper implementation for ResultSets.
+ */
+public class DefaultResultSetMapper extends ResultSetMapper {
+
+ /**
+ * Maps a ResultSet to a ResultSet. The default implementation is a NOOP.
+ *
+ * @param context A ControlBeanContext instance.
+ * @param m Method assoicated with this call.
+ * @param resultSet Result set to map.
+ * @param cal A Calendar instance for resolving date/time values.
+ * @return An object.
+ */
+ public Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
+ return resultSet;
+ }
+
+ /**
+ * Can the ResultSet which this mapper uses be closed by the database control?
+ * @return always false
+ */
+ public boolean canCloseResultSet() { return false; }
+}
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultResultSetMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultRowSetResultSetMapper.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultRowSetResultSetMapper.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultRowSetResultSetMapper.java (original)
+++ incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultRowSetResultSetMapper.java Tue Jun 14 14:14:42 2005
@@ -1,72 +1,72 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed 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.
- *
- * $Header:$
- */
-
-package org.apache.beehive.controls.system.jdbc;
-
-import com.sun.rowset.CachedRowSetImpl;
-import org.apache.beehive.controls.api.ControlException;
-import org.apache.beehive.controls.api.context.ControlBeanContext;
-import org.apache.beehive.controls.system.jdbc.JdbcControl.SQL;
-
-import javax.sql.RowSet;
-import java.lang.reflect.Method;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Calendar;
-
-/**
- * Default ResultSetMapper implementation for RowSets.
- */
-public class DefaultRowSetResultSetMapper extends ResultSetMapper {
-
- private static final TypeMappingsFactory _tmf = TypeMappingsFactory.getInstance();
-
- /**
- * Map a ResultSet to a RowSet. Type of RowSet is defined by the SQL annotation for the method.
- *
- * @param context A ControlBeanContext instance.
- * @param m Method assoicated with this call.
- * @param resultSet Result set to map.
- * @param cal A Calendar instance for resolving date/time values.
- * @return A RowSet object.
- */
- public RowSet mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
- final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
- final int maxrows = methodSQL.maxRows();
-
- try {
- CachedRowSetImpl rows = new CachedRowSetImpl();
-
- if (maxrows > 0) {
- rows.setMaxRows(maxrows);
- }
-
- rows.populate(resultSet);
- return rows;
- } catch (SQLException e) {
- throw new ControlException(e.getMessage(), e);
- }
- }
-
- /**
- * Can the ResultSet which this mapper uses be closed by the database control?
- *
- * @return always false
- */
- public boolean canCloseResultSet() { return false; }
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.system.jdbc;
+
+import com.sun.rowset.CachedRowSetImpl;
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.system.jdbc.JdbcControl.SQL;
+
+import javax.sql.RowSet;
+import java.lang.reflect.Method;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Calendar;
+
+/**
+ * Default ResultSetMapper implementation for RowSets.
+ */
+public class DefaultRowSetResultSetMapper extends ResultSetMapper {
+
+ private static final TypeMappingsFactory _tmf = TypeMappingsFactory.getInstance();
+
+ /**
+ * Map a ResultSet to a RowSet. Type of RowSet is defined by the SQL annotation for the method.
+ *
+ * @param context A ControlBeanContext instance.
+ * @param m Method assoicated with this call.
+ * @param resultSet Result set to map.
+ * @param cal A Calendar instance for resolving date/time values.
+ * @return A RowSet object.
+ */
+ public RowSet mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
+ final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
+ final int maxrows = methodSQL.maxRows();
+
+ try {
+ CachedRowSetImpl rows = new CachedRowSetImpl();
+
+ if (maxrows > 0) {
+ rows.setMaxRows(maxrows);
+ }
+
+ rows.populate(resultSet);
+ return rows;
+ } catch (SQLException e) {
+ throw new ControlException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Can the ResultSet which this mapper uses be closed by the database control?
+ *
+ * @return always false
+ */
+ public boolean canCloseResultSet() { return false; }
+}
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultRowSetResultSetMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultXmlObjectResultSetMapper.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultXmlObjectResultSetMapper.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultXmlObjectResultSetMapper.java (original)
+++ incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultXmlObjectResultSetMapper.java Tue Jun 14 14:14:42 2005
@@ -1,65 +1,65 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed 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.
- *
- * $Header:$
- */
-
-package org.apache.beehive.controls.system.jdbc;
-
-import org.apache.beehive.controls.api.ControlException;
-import org.apache.beehive.controls.api.context.ControlBeanContext;
-import org.apache.beehive.controls.system.jdbc.JdbcControl.SQL;
-
-import java.lang.reflect.Method;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Calendar;
-
-/**
- * Default ResultSetMapper implementation for XmlObjects.
- */
-public class DefaultXmlObjectResultSetMapper extends DefaultObjectResultSetMapper {
-
- /**
- * Map a ResultSet to an XmlObject. Object type is defined by the return type of the method.
- *
- * @param context A ControlBeanContext instance.
- * @param m Method associated with this call.
- * @param resultSet Result set to map.
- * @param cal A Calendar instance for resolving date/time values.
- * @return An XmlObject
- */
- public Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
-
- final Class returnType = m.getReturnType();
- final boolean isArray = returnType.isArray();
-
- try {
- if (isArray) {
- final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
- return arrayFromResultSet(resultSet, methodSQL.arrayMaxLength(), returnType, cal);
- } else {
-
- if (!resultSet.next()) {
- return _tmf.fixNull(m.getReturnType());
- }
-
- return RowMapperFactory.getRowMapper(resultSet, returnType, cal).mapRowToReturnType();
- }
- } catch (SQLException e) {
- throw new ControlException(e.getMessage(), e);
- }
- }
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.system.jdbc;
+
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.system.jdbc.JdbcControl.SQL;
+
+import java.lang.reflect.Method;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Calendar;
+
+/**
+ * Default ResultSetMapper implementation for XmlObjects.
+ */
+public class DefaultXmlObjectResultSetMapper extends DefaultObjectResultSetMapper {
+
+ /**
+ * Map a ResultSet to an XmlObject. Object type is defined by the return type of the method.
+ *
+ * @param context A ControlBeanContext instance.
+ * @param m Method associated with this call.
+ * @param resultSet Result set to map.
+ * @param cal A Calendar instance for resolving date/time values.
+ * @return An XmlObject
+ */
+ public Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
+
+ final Class returnType = m.getReturnType();
+ final boolean isArray = returnType.isArray();
+
+ try {
+ if (isArray) {
+ final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
+ return arrayFromResultSet(resultSet, methodSQL.arrayMaxLength(), returnType, cal);
+ } else {
+
+ if (!resultSet.next()) {
+ return _tmf.fixNull(m.getReturnType());
+ }
+
+ return RowMapperFactory.getRowMapper(resultSet, returnType, cal).mapRowToReturnType();
+ }
+ } catch (SQLException e) {
+ throw new ControlException(e.getMessage(), e);
+ }
+ }
+}
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/DefaultXmlObjectResultSetMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlChecker.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlChecker.java?rev=190657&r1=190656&r2=190657&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlChecker.java (original)
+++ incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlChecker.java Tue Jun 14 14:14:42 2005
@@ -1,298 +1,298 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed 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.
- *
- * $Header:$
- */
-
-package org.apache.beehive.controls.system.jdbc;
-
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.declaration.Declaration;
-import com.sun.mirror.declaration.FieldDeclaration;
-import com.sun.mirror.declaration.MethodDeclaration;
-import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.type.ArrayType;
-import com.sun.mirror.type.DeclaredType;
-import com.sun.mirror.type.InterfaceType;
-import com.sun.mirror.type.MirroredTypeException;
-import com.sun.mirror.type.PrimitiveType;
-import com.sun.mirror.type.TypeMirror;
-import com.sun.mirror.type.VoidType;
-import org.apache.beehive.controls.api.ControlException;
-import org.apache.beehive.controls.api.bean.ControlChecker;
-import org.apache.beehive.controls.system.jdbc.parser.ParameterChecker;
-import org.apache.beehive.controls.system.jdbc.parser.SqlParser;
-import org.apache.beehive.controls.system.jdbc.parser.SqlStatement;
-
-import java.util.Collection;
-import java.sql.SQLException;
-
-/**
- * Annotation checker for the JdbcControl. Invoked at compile time by the controls framework.
- */
-public class JdbcControlChecker implements ControlChecker {
-
- /**
- * Invoked by the control build-time infrastructure to process a declaration of
- * a control extension (ie, an interface annotated with @ControlExtension), or
- * a field instance of a control type.
- */
- public void check(Declaration decl, AnnotationProcessorEnvironment env) {
-
- if (decl instanceof TypeDeclaration) {
-
- //
- // Check class annotations
- //
- checkConnectionDataSource((TypeDeclaration) decl, env);
- checkConnectionDriver((TypeDeclaration) decl, env);
- checkConnectionOptions((TypeDeclaration) decl, env);
-
- //
- // Check method annotations
- //
- Collection<? extends MethodDeclaration> methods = ((TypeDeclaration) decl).getMethods();
- for (MethodDeclaration method : methods) {
- checkSQL(method, env);
-
- }
- } else if (decl instanceof FieldDeclaration) {
-
- //
- // NOOP
- //
- } else {
-
- //
- // NOOP
- //
- }
- }
-
- /**
- * Check the ConnectionDataSource annotation.
- *
- * @param decl
- * @param env
- */
- private void checkConnectionDataSource(TypeDeclaration decl, AnnotationProcessorEnvironment env) {
- final JdbcControl.ConnectionDataSource cds =
- decl.getAnnotation(JdbcControl.ConnectionDataSource.class);
- if (cds == null) {
- return;
- }
-
- //
- // NOOP
- //
- }
-
- /**
- * Check the ConnectionDriver annotation.
- *
- * @param decl
- * @param env
- */
- private void checkConnectionDriver(TypeDeclaration decl, AnnotationProcessorEnvironment env) {
- final JdbcControl.ConnectionDriver cd = decl.getAnnotation(JdbcControl.ConnectionDriver.class);
- if (cd == null) {
- return;
- }
-
- //
- // NOOP
- //
- }
-
- /**
- * Check the ConnectionOptions annotation.
- *
- * @param decl
- * @param env
- */
- private void checkConnectionOptions(TypeDeclaration decl, AnnotationProcessorEnvironment env) {
- final JdbcControl.ConnectionOptions co = decl.getAnnotation(JdbcControl.ConnectionOptions.class);
- if (co == null) {
- return;
- }
-
- //
- // NOOP
- //
- }
-
- /**
- * Check the SQL method annotation. Lots to check here, stop checking as soon as an error is found.
- *
- * @param method
- * @param env
- */
- private void checkSQL(MethodDeclaration method, AnnotationProcessorEnvironment env) {
-
- final JdbcControl.SQL methodSQL = method.getAnnotation(JdbcControl.SQL.class);
- if (methodSQL == null) {
- return;
- }
-
- //
- // check for empty SQL statement member
- //
- if (methodSQL.statement() == null || methodSQL.statement().length() == 0) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " contains an empty statement member.");
- return;
- }
-
- //
- // Make sure maxrows is not set to some negative number other than -1
- //
- int maxRows = methodSQL.maxRows();
- if (maxRows < JdbcControl.MAXROWS_ALL) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " maxRows set to invalid value: " + maxRows);
- return;
- }
-
- //
- // Make sure maxArrayLength is not set to some negative number
- //
- int arrayMax = methodSQL.arrayMaxLength();
- if (arrayMax < 1) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " arrayMaxLength set to invalid value (must be greater than 0): "
- + arrayMax);
- return;
- }
-
-
- //
- //
- // parse the SQL
- //
- //
- SqlParser _p = new SqlParser();
- SqlStatement _statement = null;
- try {
- _statement = _p.parse(methodSQL.statement());
- } catch (ControlException ce) {
- env.getMessager().printError(method.getPosition(), "Error parsing SQL statment on method: " + method.getSimpleName() + ": " + ce.toString());
- return;
- }
-
- //
- // Check that the any statement element params (delimited by '{' and '}' can be
- // matched to method parameter names. NOTE: This check is only valid on non-compiled files,
- // once compiled to a class file method parameter names are replaced with 'arg0', 'arg1', etc.
- // and cannot be used for this check.
- //
- try {
- ParameterChecker.checkReflectionParameters(_statement, method);
- } catch (ControlException e) {
- env.getMessager().printError(method.getPosition(), e.getMessage());
- return;
- }
-
- //
- // check for case of generatedKeyColumns being set, when getGeneratedKeys is not set to true
- //
- final boolean getGeneratedKeys = methodSQL.getGeneratedKeys();
- final String[] generatedKeyColumnNames = methodSQL.generatedKeyColumnNames();
- final int[] generatedKeyIndexes = methodSQL.generatedKeyColumnIndexes();
- if (getGeneratedKeys == false && (generatedKeyColumnNames.length != 0 || generatedKeyIndexes.length != 0)) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " getGeneratedKeys must be set to true in order to specify generatedKeyColumnNames or generatedKeyColumnIndexes.");
- return;
- }
-
- //
- // check that both generatedKeyColumnNames and generatedKeyColumnIndexes are not set
- if (generatedKeyColumnNames.length > 0 && generatedKeyIndexes.length > 0) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " only one of generatedKeyColumnNames or generatedKeyColumnIndexes may be set in the method annotation.");
-
- return;
- }
-
- //
- // batch update methods must return int[]
- //
- final boolean batchUpdate = methodSQL.batchUpdate();
- final TypeMirror returnType = method.getReturnType();
- if (batchUpdate) {
- if (returnType instanceof ArrayType == true) {
- final TypeMirror aType = ((ArrayType) returnType).getComponentType();
- if (aType instanceof PrimitiveType == false || ((PrimitiveType) aType).getKind() != PrimitiveType.Kind.INT) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " if batchUpdate is set to true, method must return void or an array of integers.");
- return;
- }
- } else if (returnType instanceof VoidType == false) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " if batchUpdate is set to true, method must return void or an array of integers.");
-
- return;
- }
-
- }
-
- //
- // iterator type check match
- //
- if (returnType instanceof InterfaceType) {
- String iName = ((InterfaceType) returnType).getDeclaration().getQualifiedName();
- if ("java.util.Iterator".equals(iName)) {
- String iteratorClassName = null;
- try {
- // this should always except
- methodSQL.iteratorElementType();
- } catch (MirroredTypeException mte) {
- iteratorClassName = mte.getQualifiedName();
- }
-
- if ("org.apache.beehive.controls.system.jdbc.JdbcControl.UndefinedIteratorType".equals(iteratorClassName)) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " iteratorElementType must be specified if method returns an Iterator.");
- return;
-
- }
- }
- }
-
- //
- // scrollable result set check
- //
- final JdbcControl.ScrollType scrollable = methodSQL.scrollableResultSet();
- switch (scrollable) {
- case SCROLL_INSENSITIVE:
- case SCROLL_SENSITIVE:
- case SCROLL_INSENSITIVE_UPDATABLE:
- case SCROLL_SENSITIVE_UPDATABLE:
- case FORWARD_ONLY_UPDATABLE:
- String typeName = null;
- if (returnType instanceof DeclaredType) {
- typeName = ((DeclaredType) returnType).getDeclaration().getQualifiedName();
- }
-
- if (typeName == null || "java.sql.ResultSet".equals(typeName) == false) {
- env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
- + " element scrollableResultSet specified but method does not return a ResultSet.");
- break;
- }
- case FORWARD_ONLY:
- default:
- break;
- }
- } // checkSQL
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.system.jdbc;
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.declaration.Declaration;
+import com.sun.mirror.declaration.FieldDeclaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.type.ArrayType;
+import com.sun.mirror.type.DeclaredType;
+import com.sun.mirror.type.InterfaceType;
+import com.sun.mirror.type.MirroredTypeException;
+import com.sun.mirror.type.PrimitiveType;
+import com.sun.mirror.type.TypeMirror;
+import com.sun.mirror.type.VoidType;
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.api.bean.ControlChecker;
+import org.apache.beehive.controls.system.jdbc.parser.ParameterChecker;
+import org.apache.beehive.controls.system.jdbc.parser.SqlParser;
+import org.apache.beehive.controls.system.jdbc.parser.SqlStatement;
+
+import java.util.Collection;
+import java.sql.SQLException;
+
+/**
+ * Annotation checker for the JdbcControl. Invoked at compile time by the controls framework.
+ */
+public class JdbcControlChecker implements ControlChecker {
+
+ /**
+ * Invoked by the control build-time infrastructure to process a declaration of
+ * a control extension (ie, an interface annotated with @ControlExtension), or
+ * a field instance of a control type.
+ */
+ public void check(Declaration decl, AnnotationProcessorEnvironment env) {
+
+ if (decl instanceof TypeDeclaration) {
+
+ //
+ // Check class annotations
+ //
+ checkConnectionDataSource((TypeDeclaration) decl, env);
+ checkConnectionDriver((TypeDeclaration) decl, env);
+ checkConnectionOptions((TypeDeclaration) decl, env);
+
+ //
+ // Check method annotations
+ //
+ Collection<? extends MethodDeclaration> methods = ((TypeDeclaration) decl).getMethods();
+ for (MethodDeclaration method : methods) {
+ checkSQL(method, env);
+
+ }
+ } else if (decl instanceof FieldDeclaration) {
+
+ //
+ // NOOP
+ //
+ } else {
+
+ //
+ // NOOP
+ //
+ }
+ }
+
+ /**
+ * Check the ConnectionDataSource annotation.
+ *
+ * @param decl
+ * @param env
+ */
+ private void checkConnectionDataSource(TypeDeclaration decl, AnnotationProcessorEnvironment env) {
+ final JdbcControl.ConnectionDataSource cds =
+ decl.getAnnotation(JdbcControl.ConnectionDataSource.class);
+ if (cds == null) {
+ return;
+ }
+
+ //
+ // NOOP
+ //
+ }
+
+ /**
+ * Check the ConnectionDriver annotation.
+ *
+ * @param decl
+ * @param env
+ */
+ private void checkConnectionDriver(TypeDeclaration decl, AnnotationProcessorEnvironment env) {
+ final JdbcControl.ConnectionDriver cd = decl.getAnnotation(JdbcControl.ConnectionDriver.class);
+ if (cd == null) {
+ return;
+ }
+
+ //
+ // NOOP
+ //
+ }
+
+ /**
+ * Check the ConnectionOptions annotation.
+ *
+ * @param decl
+ * @param env
+ */
+ private void checkConnectionOptions(TypeDeclaration decl, AnnotationProcessorEnvironment env) {
+ final JdbcControl.ConnectionOptions co = decl.getAnnotation(JdbcControl.ConnectionOptions.class);
+ if (co == null) {
+ return;
+ }
+
+ //
+ // NOOP
+ //
+ }
+
+ /**
+ * Check the SQL method annotation. Lots to check here, stop checking as soon as an error is found.
+ *
+ * @param method
+ * @param env
+ */
+ private void checkSQL(MethodDeclaration method, AnnotationProcessorEnvironment env) {
+
+ final JdbcControl.SQL methodSQL = method.getAnnotation(JdbcControl.SQL.class);
+ if (methodSQL == null) {
+ return;
+ }
+
+ //
+ // check for empty SQL statement member
+ //
+ if (methodSQL.statement() == null || methodSQL.statement().length() == 0) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " contains an empty statement member.");
+ return;
+ }
+
+ //
+ // Make sure maxrows is not set to some negative number other than -1
+ //
+ int maxRows = methodSQL.maxRows();
+ if (maxRows < JdbcControl.MAXROWS_ALL) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " maxRows set to invalid value: " + maxRows);
+ return;
+ }
+
+ //
+ // Make sure maxArrayLength is not set to some negative number
+ //
+ int arrayMax = methodSQL.arrayMaxLength();
+ if (arrayMax < 1) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " arrayMaxLength set to invalid value (must be greater than 0): "
+ + arrayMax);
+ return;
+ }
+
+
+ //
+ //
+ // parse the SQL
+ //
+ //
+ SqlParser _p = new SqlParser();
+ SqlStatement _statement = null;
+ try {
+ _statement = _p.parse(methodSQL.statement());
+ } catch (ControlException ce) {
+ env.getMessager().printError(method.getPosition(), "Error parsing SQL statment on method: " + method.getSimpleName() + ": " + ce.toString());
+ return;
+ }
+
+ //
+ // Check that the any statement element params (delimited by '{' and '}' can be
+ // matched to method parameter names. NOTE: This check is only valid on non-compiled files,
+ // once compiled to a class file method parameter names are replaced with 'arg0', 'arg1', etc.
+ // and cannot be used for this check.
+ //
+ try {
+ ParameterChecker.checkReflectionParameters(_statement, method);
+ } catch (ControlException e) {
+ env.getMessager().printError(method.getPosition(), e.getMessage());
+ return;
+ }
+
+ //
+ // check for case of generatedKeyColumns being set, when getGeneratedKeys is not set to true
+ //
+ final boolean getGeneratedKeys = methodSQL.getGeneratedKeys();
+ final String[] generatedKeyColumnNames = methodSQL.generatedKeyColumnNames();
+ final int[] generatedKeyIndexes = methodSQL.generatedKeyColumnIndexes();
+ if (getGeneratedKeys == false && (generatedKeyColumnNames.length != 0 || generatedKeyIndexes.length != 0)) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " getGeneratedKeys must be set to true in order to specify generatedKeyColumnNames or generatedKeyColumnIndexes.");
+ return;
+ }
+
+ //
+ // check that both generatedKeyColumnNames and generatedKeyColumnIndexes are not set
+ if (generatedKeyColumnNames.length > 0 && generatedKeyIndexes.length > 0) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " only one of generatedKeyColumnNames or generatedKeyColumnIndexes may be set in the method annotation.");
+
+ return;
+ }
+
+ //
+ // batch update methods must return int[]
+ //
+ final boolean batchUpdate = methodSQL.batchUpdate();
+ final TypeMirror returnType = method.getReturnType();
+ if (batchUpdate) {
+ if (returnType instanceof ArrayType == true) {
+ final TypeMirror aType = ((ArrayType) returnType).getComponentType();
+ if (aType instanceof PrimitiveType == false || ((PrimitiveType) aType).getKind() != PrimitiveType.Kind.INT) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " if batchUpdate is set to true, method must return void or an array of integers.");
+ return;
+ }
+ } else if (returnType instanceof VoidType == false) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " if batchUpdate is set to true, method must return void or an array of integers.");
+
+ return;
+ }
+
+ }
+
+ //
+ // iterator type check match
+ //
+ if (returnType instanceof InterfaceType) {
+ String iName = ((InterfaceType) returnType).getDeclaration().getQualifiedName();
+ if ("java.util.Iterator".equals(iName)) {
+ String iteratorClassName = null;
+ try {
+ // this should always except
+ methodSQL.iteratorElementType();
+ } catch (MirroredTypeException mte) {
+ iteratorClassName = mte.getQualifiedName();
+ }
+
+ if ("org.apache.beehive.controls.system.jdbc.JdbcControl.UndefinedIteratorType".equals(iteratorClassName)) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " iteratorElementType must be specified if method returns an Iterator.");
+ return;
+
+ }
+ }
+ }
+
+ //
+ // scrollable result set check
+ //
+ final JdbcControl.ScrollType scrollable = methodSQL.scrollableResultSet();
+ switch (scrollable) {
+ case SCROLL_INSENSITIVE:
+ case SCROLL_SENSITIVE:
+ case SCROLL_INSENSITIVE_UPDATABLE:
+ case SCROLL_SENSITIVE_UPDATABLE:
+ case FORWARD_ONLY_UPDATABLE:
+ String typeName = null;
+ if (returnType instanceof DeclaredType) {
+ typeName = ((DeclaredType) returnType).getDeclaration().getQualifiedName();
+ }
+
+ if (typeName == null || "java.sql.ResultSet".equals(typeName) == false) {
+ env.getMessager().printError(method.getPosition(), "@SQL annotation on method: " + method.getSimpleName()
+ + " element scrollableResultSet specified but method does not return a ResultSet.");
+ break;
+ }
+ case FORWARD_ONLY:
+ default:
+ break;
+ }
+ } // checkSQL
+}
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlChecker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.jcs
------------------------------------------------------------------------------
svn:eol-style = native