Fork from beehive

pull/2/head
Travis Burtrum 2017-05-28 00:29:58 -04:00
parent d8f7e6df4a
commit 59cf4ff2cd
1091 changed files with 13 additions and 174702 deletions

View File

@ -1,177 +0,0 @@
Welcome to Beehive
==================
To build Beehive, you will first need to check the source out from
Apache SVN and then install / configure required external software and
your shell environment.
Checkout Beehive from SVN
=========================
To do this, run the command:
svn checkout https://svn.apache.org/repos/asf/beehive/trunk
After running this command, you should have a directory "trunk/" which
contains the current Beehive source. If you ran this command in:
d:\java\beehive
you should have the directory:
d:\java\beehive\trunk
In the following steps, we'll refer to this as ${beehive.home}.
Install / configure external software and setup your shell
==========================================================
1) Java 5
Download: http://java.sun.com/j2se/1.5.0/download.jsp
Install Java 5 and set the JAVA_HOME environment variable to
refernce the JDK install directory. Ensure that $JAVA_HOME/bin is
available in your $PATH.
2) Ant 1.6.2+
Download: http://ant.apache.org/bindownload.cgi
Ant 1.6.2 is the minimum version required to build Beehive. Install
Ant 1.6.2 and set the ANT_HOME environment variable to reference the
Ant install directory. Ensure that $ANT_HOME/bin is available in your
$PATH. Copy junit.jar (in external/junit/) to $ANT_HOME/lib. This step is
required in order for the Ant <junit> tasks to work correctly.
3) Tomcat 5.0.x
Download: http://jakarta.apache.org/site/binindex.cgi#tomcat
Tomcat is used as the default test environment for Beehive. Install
Tomcat and set the CATALINA_HOME environment variable to reference the
Tomcat install directory. If you're installing Tomcat on Linux,
be sure to set the execute bit on the shell scripts in $CATALINA_HOME/bin.
If you installed these into d:\java, your environment variables
might look something like:
JAVA_HOME=d:\java\jdk1.5.0
CATALINA_HOME=d:\java\jakarta-tomcat-5.0.25
ANT_HOME=d:\java\apache-ant-1.6.2
Configure installed products
In order to run the Beehive tests, ensure that Tomcat has the the
"manager" role is defined in ${CATALINA_HOME}/conf/tomcat-users.xml
with a "manager" role and manager username/password of manager/manager.
This step is required in order to use the Tomcat Ant tasks to deploy
applications to Tomcat. An example of this file is available here:
${beehive.home}/test/conf/tomcat-users.xml
In the following examples, '$>' is your propmpt at $BEEHIVE_HOME, so if
you see '$>ant', type 'ant' (without the quotes) and press [enter].
In addition to the external software installed above, Beehive requires
one additional JAR to provide JSR 173 support for StAX, which is
required by XMLBeans. This JAR is downloaded from the network when
running Beehive's "bootstrap" target, so be sure to have a network
connection for your first build. A network connection is not required
for any subsequent builds. To install the JSR 173 API, run:
$>ant bootstrap
To check your Beehive build setup, run:
$>ant check.setup
This should end with "BUILD SUCCESSFUL" if you see any failures, be
sure to re-check your setup steps above.
To build Beehive, run:
$>ant clean deploy
To run the Beehive tests, run:
$>ant drt
Using Proxies With a Beehive Build
====================================
If you need to use proxies you can setup additional environment variables
so that the Ant "bootstrap" target is successful in downloading the
JSR 173 API JAR file.
PROXYHOST=<name of proxy host>
PROXYPORT=<port used for proxying>
PROXYUSER=<username for proxy authentication>
PROXYPASSWORD=<password for proxy authentication>
NONPROXYHOSTS=<hosts that should not be proxied>
SOCKSPROXYHOST=<socks proxy host name>
SOCKSPROXYPORT=<socks proxy port>
At a minimum, you will need to set PROXYHOST and PROXYPORT if your
network environment requires a proxy connection. To set these
environment variables in your shell, run:
set PROXYHOST=<name of proxy host>
in a Windows shell and
export PROXYHOST=<name of proxy host>
in a UNIX shell.
For information on proxy support using the <setproxy> task, please
visit http://ant.apache.org/manual/OptionalTasks/setproxy.html
Building Beehive documentation
=============================
The following documentation-related targets in
beehive/trunk/build.xml require that you have
Apache Forrest installed locally:
$>ant docs
$>ant build.dist
Before running these targets, complete the following steps.
1) Download and install Forrest 0.7 on your machine.
A list of available download locations is available at:
http://forrest.apache.org/mirrors.cgi
2) Copy the JAR file
apache-forrest-0.7/lib/core/xml-commons-resolver-1.1.jar
into
$ANT_HOME/lib
(This allows the Ant targets to call Forrest tasks.)
3) Ensure that FORREST_HOME is set to the following path.
On Windows machines:
set FORREST_HOME=C:\MyApacheStuff\apache-forrest-0.7
On Unix machines:
export FORREST_HOME=/MyApacheStuff/apache-forrest-0.7
4) Set the PATH as follows:
On Windows machines:
set PATH=%FORREST_HOME%\bin;%PATH%
On Unix machines:
export PATH=$FORREST_HOME/bin:$PATH
You are now ready to run these targets:
$>ant docs
$>ant build.dist

View File

@ -1,83 +0,0 @@
Developing in Beehive
=====================
Hey; we're glad you're here! If you're interested in developing Beehive, the
information below is for you. First, make sure you've read the introduction
for Beehive contributors here:
http://wiki.apache.org/beehive/For_Beehive_Developers
This should help you get started setting up Beehive in your IDE and navigating
what code is where.
You'll also need to configure your Subversion client to handle end-of-line styles
correctly. To do this, follow the directions below.
Configuring your Subversion client
==================================
Every text file must have the svn:eol-style property set to 'native'. This
causes ends-of-line to be translated to the correct format for the local
operating system when files are checked out (e.g., LF on linux, CR/LF on
Windows). You can do this on a per-file basis using the 'svn propset' command:
svn propset svn:eol-style native <file path>
An easier way to ensure that all added files have the right properties set is
to use the "auto-props" feature in the SVN client configuration file. The
location of this file varies depending on the operating system (see
http://svnbook.red-bean.com/svnbook/book.html#svn-ch-7-sect-1).
On Linux/UNIX it is located:
~/.subversion/config
On Windows, it is typically located in a hidden directory:
%SYSROOT%\Documents and Settings\<user name>\Application Data\Subversion
If you have problems locating this, make sure you can view hidden directory
contents.
Confirm the "header" named [miscellany] is uncommented.
Then, add (uncomment) the following line under the "[miscellany]" section:
enable-auto-props = yes
Then, add (uncomment) an "[auto-props]" section (include the [auto-props]
header as well) with a list of file extensions that will automatically
trigger the svn:eol-style=native property:
[auto-props]
*.txt = svn:eol-style=native
*.java = svn:eol-style=native
*.jj = svn:eol-style=native
*.xml = svn:eol-style=native
*.xsd = svn:eol-style=native
*.xsdconfig = svn:eol-style=native
*.dtd = svn:eol-style=native
*.properties = svn:eol-style=native
*.jcs = svn:eol-style=native
*.jcx = svn:eol-style=native
*.jpf = svn:eol-style=native
*.jpfs = svn:eol-style=native
Global.app = svn:eol-style=native
*.jsp* = svn:eol-style=native
*.jspx = svn:eol-style=native
*.jspf = svn:eol-style=native
*.jsf = svn:eol-style=native
*.jsfb = svn:eol-style=native
*.faces = svn:eol-style=native
*.tld = svn:eol-style=native
*.tldx = svn:eol-style=native
*.tag = svn:eol-style=native
*.tagf = svn:eol-style=native
*.html = svn:eol-style=native
*.css = svn:eol-style=native
*.js = svn:eol-style=native
*.inc = svn:eol-style=native
*.sh = svn:eol-style=native;svn:executable
*.cmd = svn:eol-style=native
*.pl = svn:eol-style=native
*.py = svn:eol-style=native
*.beaninfo = svn:eol-style=native

View File

@ -200,53 +200,3 @@
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.
============================================
Licenses for Included Dependencies
============================================
The exceptions are as follows:
============================================
org/apache/beehive/netui/util/internal/concurrent/**
============================================
"Sun hereby grants you a non-exclusive, worldwide, non-transferrable
license to use and distribute the Java Software technologies as part
of a larger work in source and binary forms, with or without
modification, provided that the following conditions are met:
-Neither the name of or trademarks of Sun may be used to endorse or
promote products derived from the Java Software technology without
specific prior written permission.
-Redistributions of source or binary code must be accompanied by the
following notice and disclaimers:
Portions copyright Sun Microsystems, Inc. Used with kind permission.
This software is provided AS IS, without a warranty of any kind. ALL
EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PUPOSE OR
NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
MICROSYSTEMS, INC. AND ITS LICENSORS SHALL NOT BE LIABLE
FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS
DERIVATIVES. IN NO EVENT WILL SUN MICROSYSTEMS, INC. OR
ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR
DATA, OR FOR DIRECT, INDIRECT,CONSQUENTIAL, INCIDENTAL
OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF
THE THEORY OR LIABILITY, ARISING OUT OF THE USE OF OR
INABILITY TO USE SOFTWARE, EVEN IF SUN MICROSYSTEMS, INC.
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that Software is not designed, licensed or intended for
use in the design, construction, operation or maintenance of any nuclear
facility."
============================================
Spring Framework 1.1.5
============================================
Licensed under terms of the Apache Software License (ASL) 2.0, provided above.

View File

@ -1,34 +0,0 @@
=========================================================================
== NOTICE file corresponding to section 4(d) of the Apache License, ==
== Version 2.0, in this case for the Apache Beehive distribution. ==
=========================================================================
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
Portions of this software were originally based on the following:
* software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
and are licensed to the Apache Software Foundation under the
"Software Grant and Corporate Contribution License Agreement"
Aside from contributions to the Apache Beehive project, this
software also includes:
* One or more JARs from the Jakarta Commons, Jakarta ORO, Log4J,
Struts, and Velocity Apache projects, Copyright (c) 1999-2006
Apache Software Foundation
* One or more JARs from the Spring Framework Project
See the LICENSE.txt file for information on all licenses associated with
this software.
COPYRIGHT NOTICES:
* Apache Beehive is bundled with source and binaries from the JSR-166
implementation licensed under the relevant license in LICENSE.txt.
The source code and license are avaialble at:
http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/readme
* Apache Beehive is bundled with binaries from The Spring Framework Project

View File

@ -1,21 +0,0 @@
Welcome to Beehive!
If you've come here to learn more about Beehive, here are a few
starting points:
BUILDING.txt: How to build Beehive on your machine.
DEVELOPING.txt Technical notes on contributing/committing files.
LICENSE.txt: The Apache License and any other relevant licenses for this software.
NOTICE.txt: Attribution notices required by various contributions.
The Apache Beehive website is located at:
http://beehive.apache.org
And, the Beehive wiki is located at:
http://wiki.apache.org/beehive
Both of these contain additionl resources for getting started
with developing or using Beehive.

View File

@ -1,98 +0,0 @@
This directory contains the Beehive Controls source and test files. This
README provides an overview of the basic directory structure, and describes
some of the useful ant targets for building, generating javadoc, and running
tests for the Controls runtime.
SOURCE DIRECTORY STRUCTURE:
./src:
Contains all of the source files for the Beehive Controls runtime. When the
runtime is built, all of the generated classes end up in
build/jars/controls.jar.
./src/api:
Contains all of the source files for Controls public APIs used by Control
authors or clients. All annotation type, interfaces, and classes in the public
API set live within the org.apache.beehive.controls.api.* package space.
./src/spi:
Contains a small set of service provider interfaces used to adapt or
extend the Controls runtime for a specific environment. The audience for
the SPI set is primary system developers who want to integrate the runtime
into a specific container or application server environment, implement a
specific type of interceptor or instantiation factory, etc. All of the
classes in the SPI set live within the org.apache.beehive.controls.spi.*
package space.
./src/runtime:
Contains the Control runtime implementation classes. There are several
base classes used for code-generated ControlBeans as well as supporting
runtime classes for properties, contextual services, container integration,
etc. Control authors or clients should never reference any of these
runtime classes directly. All of the runtime classes live within the
org.apache.beehive.controls.runtime.* package space.
SOURCE DEPENDENCIES:
The dependencies across the various types of Control sources are:
api -> spi : API public factory classes depend upon some SPI interfaces
spi -> api : the SPI classes often consume public classes
runtime -> api, spi : the runtime classes reference both API and SPI types
Note: there are *no* dependencies from public interfaces to runtime classes.
This relationship is enforced by actually having them compile separately
(api + spi first, then runtime).
SOURCE ANT TARGETS
This section describes some of the available ant targets from the Controls
root directory.
ant build:
Compiles all annotation type, interface, and class files in the API, SPI, and
runtime directory and creates build/jars/controls.jar to contain them.
ant docs:
Generates javadoc documention for all API, SPI, and runtime classes and puts
them in build/docs. After running this target, you can browse to
file:build/docs/apidocs/classref_controls/index.html to view them.
ant clean:
Removes all generated output files from any of the build targets in the top
level or test directories.
TEST INFRASTRUCTURE:
The Controls runtime test infrastructure lives under the test subdirectory. It
includes a variety of test for Controls running in different context, from
vanilla Junit/java tests to running Controls inside of the various containers
that are part of the Beehive programming model: JWS, JPF, and nesting inside
of other controls. More details about the Controls runtime test tools
can be found at http://wiki.apache.org/beehive/Controls/TestingControls.
CONTROLS TEST TARGETS:
There are two main test targets for running Controls tests. These should be run
from within the controls/test directory:
ant checkin.tests:
These are a set of checkin tests that do shallow testing of a broad range of
functionality. These should be run and pass 100% before a committer submits
any Controls runtime changes.
ant detailed.tests:
This runs all control tests. Since some of them are test cases that are the
basis of open JIRA issues, THESE TESTS ARE NOT EXPECTED TO PASS 100%. Currently,
there is no good filter for running the detailed tests that are expected to
pass, but it has been suggested that this would be a good thing (to enable
deeper testing of larger changes).

View File

@ -1,71 +0,0 @@
<?xml version="1.0"?>
<!--
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.
$Header:$
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.moparisthebest.beehive</groupId>
<artifactId>beehive</artifactId>
<version>1.0.5-SNAPSHOT</version>
</parent>
<artifactId>beehive-controls</artifactId>
<name>beehive-controls</name>
<dependencies>
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity-dep</artifactId>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>com.moparisthebest.aptIn16</groupId>
<artifactId>apt-mirror-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,63 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api;
/**
* The ControlException class declares an unchecked exception that is thrown by the Controls
* runtime under certain failure conditions.
*/
public class ControlException extends RuntimeException
{
/**
* Default constructor.
*/
public ControlException() {
super();
}
/**
* Constructs a ControlException object with the specified String as a message.
*
* @param message The message to use.
*/
public ControlException(String message)
{
super(message);
}
/**
* Constructs a ControlException with the specified cause.
* @param t the cause
*/
public ControlException(Throwable t) {
super(t);
}
/**
* Constructs a ControlException object using the specified String as a message, and the
* specified Throwable as a nested exception.
*
* @param message The message to use.
* @param t The exception to nest within this exception.
*/
public ControlException(String message, Throwable t)
{
super(message + "[" + t + "]", t);
}
}

View File

@ -1,45 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.assembly;
/**
* Control implementations may need to do build-time work on or impacted by
* their control client(s), such as side-effecting their client's deployment
* descriptors, or generating additional files that are implementation-
* specific.
*
* The build phase where this work is done is called assembly, and occurs
* at the granularity level of the J2EE module.
* The control author participates in this phase by authoring classes that
* implement the ControlAssembler interface, and associating such classes
* with control implementations. Instances of ControlAssembler are then
* called at assembly-time by build tools.
*/
public interface ControlAssembler
{
/**
* A ControlAssembler implementation's assemble method is called once
* per control assembler per module per assembly-time pass. The call
* passes a ControlAssemblyContext, from which information such as the
* list of client classes in the module that use the control can be
* obtained.
*/
void assemble(ControlAssemblyContext cac) throws ControlAssemblyException;
}

View File

@ -1,171 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.assembly;
import java.io.File;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.Set;
import com.sun.mirror.apt.Messager;
/**
* Control assemblers are passed a ControlAssemblyContext at the time they are
* invoked; the context allows the assemblers to interact with their external
* environment (checking files, side-effecting deployment descriptors, emitting
* code parameterized by the specifics of the control extension, etc).
*
* Beehive provides ControlAssemblyContext implementations that expose the
* standard environments of J2EE applications and modules. Vendor-specific
* implementations may provide access to their specific environment information,
* such as vendor-specific descriptors, via definition and implementation
* of additional interfaces. ControlAssemblers should use reflection to
* determine if the ControlAssemblyContext implementation they are passed
* supports a particular set of environment features.
*/
public interface ControlAssemblyContext
{
/**
* Providers of ControlAssemblyContext implementations MUST implement
* Factory and newInstance to return their implementation.
*/
interface Factory
{
/**
* Creates a new instance of a ControlAssemblyContext implementation.
*
* @param controlIntfOrExt public interface/extension of the control
* type being assembled
* @param bindings map of control implementation bindings, null
* means use defaults.
* @param clients set of clients that use this control type.
* @param moduleRoot file root of the J2EE module containing the
* control clients to be assembled
* @param moduleName name of the J2EE module containing the
* control clients to be assembled
* @param srcOutputRoot file root of a location where assemblers
* should output any sources they create that
* may need further processing before use.
* @return a new instance of a ControlAssemblyContext implementation
*/
ControlAssemblyContext newInstance( Class controlIntfOrExt,
Map<String,String> bindings,
Set<String> clients,
File moduleRoot,
String moduleName,
File srcOutputRoot )
throws ControlAssemblyException;
}
/**
* Providers of ControlAssemblyContext implementations may implement
* EJBModule to provide access to an EJB module environment.
*/
interface EJBModule
{
// TODO: Provide more abstract helpers for common tasks.
// E.g. addResourceRef().
File getEjbJarXml();
}
/**
* Providers of ControlAssemblyContext implementations may implement
* WebAppModule to provide access to a webapp module environment.
*/
interface WebAppModule
{
File getWebXml();
}
/**
* Providers of ControlAssemblyContext implementations may implement
* EntAppModule to provide access to an enterprise application module
* environment.
*/
interface EntAppModule
{
File getApplicationXml();
}
/**
* @return the interface type of the control being assembled (annotated
* w/ ControlExtension or ControlInterface)
*/
Class getControlType();
/**
* @return the most derived interface of the control being assembled that
* is annotated with ControlInterface (may return the same as
* getControlType() if the control type is non-extended)
*/
Class getMostDerivedControlInterface();
/**
* @return an annotation on the interface returned by
* getControlType()
*/
<T extends Annotation> T
getControlAnnotation(Class<T> annotationClass);
/**
* @return an annotation on a method on the interface
* returned by getControlType()
*/
<T extends Annotation> T
getControlMethodAnnotation(Class<T> annotationClass, Method m)
throws NoSuchMethodException;
/**
* @return the defaultBinding member of the ControlInterface
*/
String getDefaultImplClassName();
/**
* @return the output directory into which "compilable" source should be output.
*/
File getSrcOutputDir();
/**
* @return the root of the module for which assembly is taking place.
*/
File getModuleDir();
/**
* @return the name of the module for which assembly is taking place.
*/
String getModuleName();
/**
* @return the set of clients (by class name) which use the control type
*/
Set<String> getClients();
/**
* @return a Messager implementation that can be used to emit diagnostics during the
* assembly process.
*/
Messager getMessager();
/**
* @return true if the assembly process reported errors via the Messager
*/
boolean hasErrors();
}

View File

@ -1,37 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.assembly;
/**
* Checked exceptions thrown during the assembly process. ControlAssembler
* implementations may throw this exception in their assemble() method, which
* will halt the assembly process.
*/
public class ControlAssemblyException extends Exception
{
public ControlAssemblyException(String msg)
{
super(msg);
}
public ControlAssemblyException(String msg, Throwable cause)
{
super(msg, cause);
}
}

View File

@ -1,28 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.assembly;
/**
* The default or "empty" control assembler that's assigned to an @ControlImplementation's
* assembler attribute if none is provided.
*/
public final class DefaultControlAssembler implements ControlAssembler
{
public void assemble(ControlAssemblyContext cac) throws ControlAssemblyException { };
}

View File

@ -1,90 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.bean;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
/**
* AnnotationConstraints defines meta-annotations that allow
* specification of additional constraints that aren't
* expressible using J2SE 5.0 meta-annotations.
*
* Actual enforcement of these semantics is implementation dependent.
* An <code>apt</code>-based reference implementation is provided by
* {@link org.apache.beehive.controls.runtime.bean.AnnotationConstraintValidator}.
*
* @see org.apache.beehive.controls.runtime.bean.AnnotationConstraintValidator
*/
public interface AnnotationConstraints
{
/**
* Defines a number of simple constraints on the way annotation members
* can be used together.
*
* @see MembershipRule
*/
public enum MembershipRuleValues
{
AT_LEAST_ONE,
AT_MOST_ONE,
EXACTLY_ONE,
ALL_IF_ANY
}
/**
* Provides a mechanism for enforcing constraints between members of
* an annotation (such a mechanism is absent from J2SE 5.0; for example,
* given an annotation with members 'a' and 'b' there is no way to say
* that they are mutually exclusive).
*
* @see MembershipRuleValues
*/
@Target({ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface MembershipRule
{
/** Required, the membership rule.*/
MembershipRuleValues value();
/** Optional list of member names to apply rule against. Empty array implies all members. */
String[] memberNames() default {};
}
/**
* Defines whether the annotation decorated by this
* annotation can overriden externally (a marker interface).
*/
@Target({ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface AllowExternalOverride
{
}
/**
* Specifies the version of the control runtime required by this annotation.
*/
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface RequiredRuntimeVersion
{
String value(); // no default
}
}

View File

@ -1,214 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.bean;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>AnnotationMemberTypes defines a set of annotations meant to used on
* annotation members to specify additional syntatic and semantic behaviour
* or constraints.</p>
*
* <p>J2SE 5 annotation members provide a very weak level of syntactic and
* semantic enforcement. Annotation members may only be a certain type
* (mostly primitives, arrays, plus java.lang.String and a few other classes);
* it is often useful to be more specific than those types permit.</p>
*
* <p>Consider the following example:</p>
*
* <pre>
* public &#064;interface LastChanged
* {
* &#064;AnnotationMemberTypes.Date()
* public String date();
* }
* </pre>
*
* <p>The use of <code>&#064;AnnotationMemberTypes.Date</code> means that the
* value of the <code>date</code> string must be a date in some standard
* form.</p>
*
* <p>AnnotationMemberTypes defines a set of annotations and their semantics,
* but actual enforcement of those semantics is implementation dependent.
* An <code>apt</code>-based reference implementation is provided by
* {@link org.apache.beehive.controls.runtime.bean.AnnotationConstraintValidator}.</p>
*
* @see org.apache.beehive.controls.runtime.bean.AnnotationConstraintValidator
*/
public interface AnnotationMemberTypes
{
public final static String OPTIONAL_STRING = "";
public final static double OPTIONAL_DOUBLE = Double.MIN_VALUE;
public final static float OPTIONAL_FLOAT = Float.MIN_VALUE;
public final static int OPTIONAL_INT = Integer.MIN_VALUE;
public final static long OPTIONAL_LONG = Long.MIN_VALUE;
public final static short OPTIONAL_SHORT = Short.MIN_VALUE;
public final static char OPTIONAL_CHAR = Character.MIN_VALUE;
public final static byte OPTIONAL_BYTE = Byte.MIN_VALUE;
public final static int UNLIMITED_PLACES = -1;
/**
* Marks a member as optional. Member must have
* a default value.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Optional
{
}
/**
* Member must be a String value.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Text
{
boolean isLong() default false;
int maxLength() default Integer.MAX_VALUE;
}
/**
* Member is a Decimal Value.
* Can be applied to a member that returns float, double or String.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Decimal
{
int places() default UNLIMITED_PLACES;
double minValue() default Double.MIN_VALUE;
double maxValue() default Double.MAX_VALUE;
}
/**
* Member is an Integer value.
* Can be applied to a member that returns String or int.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Int
{
int minValue() default Integer.MIN_VALUE;
int maxValue() default Integer.MAX_VALUE;
}
/**
* Member is a Date in the format specified (default is YYYY/MM/DD)
* Only valid on a member that returns String
* @see java.text.SimpleDateFormat when selecting another date format.
* Note: JSR175 does not allow java.util.Date as
* a member type.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Date
{
String format() default "yyyy/MM/dd";
String minValue() default "";
String maxValue() default "";
}
/**
* Member is a URI
* Only valid on a member that returns String
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface URI
{
}
/**
* Member is a URN
* Only valid on a member that returns String
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface URN
{
}
/**
* Member is a URL
* Only valid on a member that returns String
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface URL
{
}
/**
* Member is a QName
* Only valid on a member that returns String
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface QName
{
}
/**
* Member contains well formed XML
* Only valid on a member that returns String
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface XML
{
}
/**
* Member is a File Path
* Compiler MUST validate that value points
* to a <code>readable</code> file.
* Only valid on a member that returns String.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface FilePath
{
}
/**
* Member is a JNDI name.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface JndiName
{
/**
* Defines the type of JNDI resource reference by a member.
*/
public enum ResourceType
{
DATASOURCE,
EJB,
JMS_TOPIC,
JMS_QUEUE ,
OTHER
}
ResourceType resourceType();
}
}

View File

@ -1,44 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.bean;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* The Control annotation type is used to annotate a field within a control
* client source file that is a control reference. It is the declarative
* mechanism for instantiating controls in Java clients. Java Controls
* runtime implementations will automatically initialize such annotated field
* references to an appropriate Java Control Bean of the requested type,
* and perform event listener hookup etc.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface Control
{
/**
* Optional member used to specify the control interface class.
* Typically only necessary to resolve ambiguities when multiple
* control interfaces with same name but different packages are present.
*/
Class<?> interfaceHint() default Object.class;
}

View File

@ -1,76 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.bean;
import java.beans.beancontext.BeanContext;
import java.beans.beancontext.BeanContextProxy;
import org.apache.beehive.controls.api.context.ControlBeanContext;
/**
* The ControlBean interface defines a base set of methods that are implemented by all
* <code>JavaBeans</code> that host Java Controls.
* <p>
* A ControlBean will implement the <code>java.beans.beancontext.BeanContextProxy</code>
* interface to provide a way to get the <code>BeanContext</code> directly associated
* with the Java Control. The <code>getBeanContext()</code> API on the interface will
* return the parent (containing) context.
*
* @see java.beans.beancontext.BeanContextProxy
*/
public interface ControlBean extends BeanContextProxy, java.io.Serializable
{
/**
* The IDSeparator character is used to separated individual control IDs in nesting
* scenarios whether the identifier is actually a composite path that represents
* a nesting relationship.
*/
public static final char IDSeparator = '/';
/**
* Returns the <code>java.beans.beancontext.BeanContext</code> that provides the parent
* context for the Java Control.
* @return the containing <code>BeanContext</code> for the Java ControlBean.
*
* @see java.beans.beancontext.BeanContext
*/
BeanContext getBeanContext();
/**
* Returns the <code>org.apache.beehive.controls.api.context.ControlBeanContext</code> instance
* that provides the local context for this control bean. <b>This is not the parent
* context for the control.</b> It is the context that would be the parent context for
* any nested controls hosted by this control.
*/
ControlBeanContext getControlBeanContext();
/**
* Returns the unique control ID associated with the Java ControlBean. This control ID
* is guaranteed to be unique within the containing <code>BeanContext</code>
* @return the control ID
*/
String getControlID();
/**
* Returns the Java Control public interface for the ControlBean. This interface defines
* the operations and events exposed by the Java Control to its clients.
* @return the control public interface
*/
Class getControlInterface();
}

View File

@ -1,44 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.bean;
import com.sun.mirror.apt.AnnotationProcessorEnvironment;
import com.sun.mirror.declaration.Declaration;
/**
* The ControlChecker interface is implemented by control authors wishing to
* enforce rich semantic validation on extension and field instance declarations of
* their controls. By supplying a ControlChecker implementation (a "checker")
* and associating it with your control's public interface, when an extension (.jcx)
* of your control is processed at build-time, the checker will be invoked and
* can do rich validation of the jcx type and field instances via introspection and
* analysis of the jcx's type structure, signatures and annotations.
* <p>
* Checkers are instantiated by, and required to implement, a no-arg constructor.
* They are provided with type information and context via the Sun mirror API.
*/
public interface 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);
}

View File

@ -1,34 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.bean;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* The ControlExtension annotation type is used to annotate a control extension interface.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface ControlExtension
{
// Members parameterizing the control extension will be added here
}

View File

@ -1,56 +0,0 @@
/*
* 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.
*
* $Header:$
*/
package org.apache.beehive.controls.api.bean;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.apache.beehive.controls.api.assembly.ControlAssembler;
import org.apache.beehive.controls.api.assembly.DefaultControlAssembler;
/**
* The ControlImplementation annotation type is used to annotate the implementation class for a
* Java Control. It marks the class as a control implementation and (in the future) parameterizes
* it.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface ControlImplementation
{
/** class name for the Class (which implements
* com.bea.control.assembly.ControlAssembler) whose assemble()
* method is called at assembly time - if left Void then no
* special assembly is needed
*/
Class assemblyHelperClass() default java.lang.Void.class; // DEPRECATED
/**
* Class that implements ControlAssembler, which gets called at assembly time.
* Default implementation does nothing.
*/
Class<? extends ControlAssembler> assembler() default DefaultControlAssembler.class;
/**
* Specifies whether the control implementation class contains state that should be
* serialized as part of the containing Control/JavaBean or is fully stateless/transient.
*/
boolean isTransient() default false; // default to assuming stateful
}

View File

@ -1,61 +0,0 @@
/*
* 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
*