Author: remy.maucherat(a)jboss.com
Date: 2009-11-10 19:31:24 -0500 (Tue, 10 Nov 2009)
New Revision: 1262
Removed:
trunk/java/org/apache/jasper/compiler/JCICompiler.java
trunk/java/org/apache/naming/factory/MailSessionFactory.java
trunk/java/org/apache/naming/factory/SendMailFactory.java
trunk/java/org/apache/naming/factory/webservices/
trunk/lib/commons-jci-core-1.0.jar
trunk/lib/jboss-jaxrpc.jar
trunk/lib/mail.jar
trunk/lib/wsdl4j.jar
Modified:
trunk/.classpath
Log:
- Drop dependencies.
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2009-11-11 00:19:16 UTC (rev 1261)
+++ trunk/.classpath 2009-11-11 00:31:24 UTC (rev 1262)
@@ -2,9 +2,5 @@
<classpath>
<classpathentry excluding="**/.svn/**" kind="src"
path="java"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="lib/jboss-jaxrpc.jar"/>
- <classpathentry kind="lib" path="lib/mail.jar"/>
- <classpathentry kind="lib" path="lib/wsdl4j.jar"/>
- <classpathentry kind="lib"
path="lib/commons-jci-core-1.0.jar"/>
<classpathentry kind="output" path=".settings/output"/>
</classpath>
Deleted: trunk/java/org/apache/jasper/compiler/JCICompiler.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JCICompiler.java 2009-11-11 00:19:16 UTC (rev
1261)
+++ trunk/java/org/apache/jasper/compiler/JCICompiler.java 2009-11-11 00:31:24 UTC (rev
1262)
@@ -1,137 +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.
- */
-
-package org.apache.jasper.compiler;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-
-import org.apache.commons.jci.compilers.CompilationResult;
-import org.apache.commons.jci.compilers.JavaCompiler;
-import org.apache.commons.jci.compilers.JavaCompilerFactory;
-import org.apache.commons.jci.compilers.JavaCompilerSettings;
-import org.apache.commons.jci.problems.CompilationProblem;
-import org.apache.commons.jci.readers.FileResourceReader;
-import org.apache.commons.jci.stores.FileResourceStore;
-import org.apache.jasper.JasperException;
-
-/**
- * JDT class compiler. This compiler will load source dependencies from the
- * context classloader, reducing dramatically disk access during
- * the compilation process.
- *
- * @author Cocoon2
- * @author Remy Maucherat
- */
-public class JCICompiler extends org.apache.jasper.compiler.Compiler {
-
-
- /**
- * Compile the servlet from .java file to .class file
- */
- protected void generateClass(String[] smap)
- throws FileNotFoundException, JasperException, Exception {
-
- long t1 = 0;
- if (log.isDebugEnabled()) {
- t1 = System.currentTimeMillis();
- }
-
- String packageName = ctxt.getServletPackageName();
- ClassLoader classLoader = ctxt.getJspLoader();
-
- String targetResource = (((packageName.length() != 0) ? (packageName +
".") : "")
- + ctxt.getServletClassName()).replace('.', '/') +
".java";
- String[] resources = new String[] {targetResource};
-
- JavaCompiler javaCompiler = (new
JavaCompilerFactory()).createCompiler(options.getCompiler().substring(4));
- FileResourceReader reader = new
FileResourceReader(ctxt.getOptions().getScratchDir());
- FileResourceStore store = new
FileResourceStore(ctxt.getOptions().getScratchDir());
- JavaCompilerSettings settings = javaCompiler.createDefaultSettings();
- if (settings == null) {
- settings = new JavaCompilerSettings();
- }
- settings.setDeprecations(false);
- if (ctxt.getOptions().getJavaEncoding() != null) {
- settings.setSourceEncoding(ctxt.getOptions().getJavaEncoding());
- }
- if (ctxt.getOptions().getClassDebugInfo()) {
- // No support
- }
- // Source JVM
- if (ctxt.getOptions().getCompilerSourceVM() != null) {
- settings.setSourceVersion(ctxt.getOptions().getCompilerSourceVM());
- } else {
- // Default to 1.5
- settings.setSourceVersion("1.5");
- }
- // Target JVM
- if (ctxt.getOptions().getCompilerTargetVM() != null) {
- settings.setTargetVersion(ctxt.getOptions().getCompilerTargetVM());
- } else {
- // Default to 1.5
- settings.setTargetVersion("1.5");
- }
-
- CompilationResult result = javaCompiler.compile(resources, reader, store,
classLoader, settings);
-
- ArrayList<JavacErrorDetail> problemList = new
ArrayList<JavacErrorDetail>();
- CompilationProblem[] problems = result.getErrors();
- if (problems != null) {
- try {
- for (int i = 0; i < problems.length; i++) {
- CompilationProblem problem = problems[i];
- problemList.add(ErrorDispatcher.createJavacError
- (problem.getFileName(), pageNodes, new
StringBuilder(problem.getMessage()),
- problem.getStartLine(), ctxt));
- }
- } catch (JasperException e) {
- log.error("Error visiting node", e);
- }
- }
-
- if (!ctxt.keepGenerated()) {
- File javaFile = new File(ctxt.getServletJavaFileName());
- javaFile.delete();
- }
-
- if (!problemList.isEmpty()) {
- JavacErrorDetail[] jeds =
- (JavacErrorDetail[]) problemList.toArray(new JavacErrorDetail[0]);
- errDispatcher.javacError(jeds);
- }
-
- if( log.isDebugEnabled() ) {
- long t2=System.currentTimeMillis();
- log.debug("Compiled " + ctxt.getServletJavaFileName() + "
"
- + (t2-t1) + "ms");
- }
-
- if (ctxt.isPrototypeMode()) {
- return;
- }
-
- // JSR45 Support
- if (! options.isSmapSuppressed()) {
- SmapUtil.installSmap(smap);
- }
-
- }
-
-
-}
Deleted: trunk/java/org/apache/naming/factory/MailSessionFactory.java
===================================================================
--- trunk/java/org/apache/naming/factory/MailSessionFactory.java 2009-11-11 00:19:16 UTC
(rev 1261)
+++ trunk/java/org/apache/naming/factory/MailSessionFactory.java 2009-11-11 00:31:24 UTC
(rev 1262)
@@ -1,157 +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.
- */
-
-package org.apache.naming.factory;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-import javax.mail.Authenticator;
-import javax.mail.PasswordAuthentication;
-import javax.mail.Session;
-import javax.naming.Name;
-import javax.naming.Context;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import javax.naming.spi.ObjectFactory;
-
-/**
- * <p>Factory class that creates a JNDI named JavaMail Session factory,
- * which can be used for managing inbound and outbound electronic mail
- * messages via JavaMail APIs. All messaging environment properties
- * described in the JavaMail Specification may be passed to the Session
- * factory; however the following properties are the most commonly used:</p>
- * <ul>
- * <li>
- * <li><strong>mail.smtp.host</strong> - Hostname for outbound
transport
- * connections. Defaults to <code>localhost</code> if not
specified.</li>
- * </ul>
- *
- * <p>This factory can be configured in a
<code><DefaultContext></code>
- * or <code><Context></code> element in your
<code>conf/server.xml</code>
- * configuration file. An example of factory configuration is:</p>
- * <pre>
- * <Resource name="mail/smtp" auth="CONTAINER"
- * type="javax.mail.Session"/>
- * <ResourceParams name="mail/smtp">
- * <parameter>
- * <name>factory</name>
- *
<value>org.apache.naming.factory.MailSessionFactory</value>
- * </parameter>
- * <parameter>
- * <name>mail.smtp.host</name>
- * <value>mail.mycompany.com</value>
- * </parameter>
- * </ResourceParams>
- * </pre>
- *
- * @author Craig R. McClanahan
- * @version $Revision$ $Date$
- */
-
-public class MailSessionFactory implements ObjectFactory {
-
-
- /**
- * The Java type for which this factory knows how to create objects.
- */
- protected static final String factoryType = "javax.mail.Session";
-
-
- /**
- * Create and return an object instance based on the specified
- * characteristics.
- *
- * @param refObj Reference information containing our parameters, or null
- * if there are no parameters
- * @param name The name of this object, relative to context, or null
- * if there is no name
- * @param context The context to which name is relative, or null if name
- * is relative to the default initial context
- * @param env Environment variables, or null if there are none
- *
- * @exception Exception if an error occurs during object creation
- */
- public Object getObjectInstance(Object refObj, Name name, Context context,
- Hashtable env) throws Exception
- {
-
- // Return null if we cannot create an object of the requested type
- final Reference ref = (Reference) refObj;
- if (!ref.getClassName().equals(factoryType))
- return (null);
-
- // Create a new Session inside a doPrivileged block, so that JavaMail
- // can read its default properties without throwing Security
- // exceptions.
- //
- // Bugzilla 31288, 33077: add support for authentication.
- return AccessController.doPrivileged( new PrivilegedAction() {
- public Object run() {
-
- // Create the JavaMail properties we will use
- Properties props = new Properties();
- props.put("mail.transport.protocol", "smtp");
- props.put("mail.smtp.host", "localhost");
-
- String password = null;
-
- Enumeration attrs = ref.getAll();
- while (attrs.hasMoreElements()) {
- RefAddr attr = (RefAddr) attrs.nextElement();
- if ("factory".equals(attr.getType())) {
- continue;
- }
-
- if ("password".equals(attr.getType())) {
- password = (String) attr.getContent();
- continue;
- }
-
- props.put(attr.getType(), (String) attr.getContent());
- }
-
- Authenticator auth = null;
- if (password != null) {
- String user = props.getProperty("mail.smtp.user");
- if(user == null) {
- user = props.getProperty("mail.user");
- }
-
- if(user != null) {
- final PasswordAuthentication pa = new
PasswordAuthentication(user, password);
- auth = new Authenticator() {
- protected PasswordAuthentication
getPasswordAuthentication() {
- return pa;
- }
- };
- }
- }
-
- // Create and return the new Session object
- Session session = Session.getInstance(props, auth);
- return (session);
-
- }
- } );
-
- }
-
-
-}
Deleted: trunk/java/org/apache/naming/factory/SendMailFactory.java
===================================================================
--- trunk/java/org/apache/naming/factory/SendMailFactory.java 2009-11-11 00:19:16 UTC (rev
1261)
+++ trunk/java/org/apache/naming/factory/SendMailFactory.java 2009-11-11 00:31:24 UTC (rev
1262)
@@ -1,126 +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.
- */
-
-package org.apache.naming.factory;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Hashtable;
-import java.util.Properties;
-import java.util.Enumeration;
-import javax.mail.Session;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimePart;
-import javax.mail.internet.MimePartDataSource;
-import javax.naming.Name;
-import javax.naming.Context;
-import javax.naming.Reference;
-import javax.naming.RefAddr;
-import javax.naming.spi.ObjectFactory;
-
-/**
- * Factory class that creates a JNDI named javamail MimePartDataSource
- * object which can be used for sending email using SMTP.
- * <p>
- * Can be configured in the DefaultContext or Context scope
- * of your server.xml configuration file.
- * <p>
- * Example:
- * <p>
- * <pre>
- * <Resource name="mail/send" auth="CONTAINER"
- * type="javax.mail.internet.MimePartDataSource"/>
- * <ResourceParams name="mail/send">
- * <parameter><name>factory</name>
- * <value>org.apache.naming.factory.SendMailFactory</value>
- * </parameter>
- * <parameter><name>mail.smtp.host</name>
- * <value>your.smtp.host</value>
- * </parameter>
- * <parameter><name>mail.smtp.user</name>
- * <value>someuser</value>
- * </parameter>
- * <parameter><name>mail.from</name>
- * &lt;value>someuser(a)some.host&lt;/value>
- * </parameter>
- * <parameter><name>mail.smtp.sendpartial</name>
- * <value>true</value>
- * </parameter>
- * <parameter><name>mail.smtp.dsn.notify</name>
- * <value>FAILURE</value>
- * </parameter>
- * <parameter><name>mail.smtp.dsn.ret</name>
- * <value>FULL</value>
- * </parameter>
- * </ResourceParams>
- * </pre>
- *
- * @author Glenn Nielsen Rich Catlett
- */
-
-public class SendMailFactory implements ObjectFactory
-{
- // The class name for the javamail MimeMessageDataSource
- protected final String DataSourceClassName =
- "javax.mail.internet.MimePartDataSource";
-
- public Object getObjectInstance(Object RefObj, Name Nm, Context Ctx,
- Hashtable Env) throws Exception
- {
- final Reference Ref = (Reference)RefObj;
-
- // Creation of the DataSource is wrapped inside a doPrivileged
- // so that javamail can read its default properties without
- // throwing Security Exceptions
- if (Ref.getClassName().equals(DataSourceClassName)) {
- return AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run() {
- // set up the smtp session that will send the message
- Properties props = new Properties();
- // enumeration of all refaddr
- Enumeration list = Ref.getAll();
- // current refaddr to be set
- RefAddr refaddr;
- // set transport to smtp
- props.put("mail.transport.protocol", "smtp");
-
- while (list.hasMoreElements()) {
- refaddr = (RefAddr)list.nextElement();
-
- // set property
- props.put(refaddr.getType(), (String)refaddr.getContent());
- }
- MimeMessage message = new MimeMessage(
- Session.getInstance(props));
- try {
- String from = (String)Ref.get("mail.from").getContent();
- message.setFrom(new InternetAddress(from));
- message.setSubject("");
- } catch (Exception e) {}
- MimePartDataSource mds = new MimePartDataSource(
- (MimePart)message);
- return mds;
- }
- } );
- }
- else { // We can't create an instance of the DataSource
- return null;
- }
- }
-}
Deleted: trunk/lib/commons-jci-core-1.0.jar
===================================================================
(Binary files differ)
Deleted: trunk/lib/jboss-jaxrpc.jar
===================================================================
(Binary files differ)
Deleted: trunk/lib/mail.jar
===================================================================
(Binary files differ)
Deleted: trunk/lib/wsdl4j.jar
===================================================================
(Binary files differ)