incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r611261 [43/43] - in /incubator/imperius/trunk: ./ imperius-javaspl/ imperius-javaspl/src/main/java/org/apache/imperius/javaspl/ imperius-splcore/ imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/ imperius-splcore/src...
Date Fri, 11 Jan 2008 18:57:14 GMT
Modified: incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/CommandLineExecution.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/CommandLineExecution.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/CommandLineExecution.java
(original)
+++ incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/CommandLineExecution.java
Fri Jan 11 10:56:30 2008
@@ -1,95 +1,95 @@
-/*
- * 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.
- */
-/**/
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.javaspl.samples.userdefinedmethods;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public class CommandLineExecution implements Expression 
-{
-
-	private List inputParams =null;
-	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-
-	public CommandLineExecution(List input, boolean boo)
-	{
-		System.out.println(" creating sendMail action");
-		this.inputParams=input;
-	}
-	public Object evaluate() throws SPLException 
-	{
-		
-		Expression commandExpression=(Expression)this.inputParams.get(0);
-		Object command=commandExpression.evaluate();
-		System.out.println("command :"+command);
-
-		Runtime runtime=Runtime.getRuntime();
-		try{
-			runtime.exec((String)command);
-			System.out.println("command execution completed :"+command);
-			System.out.println("");
-
-			
-		}
-		catch(IOException e){
-			logger.severe(Thread.currentThread().getName()+" "+e.getMessage());
-            e.printStackTrace();
-		}
-		
-		return new Boolean(true);
-	}
-
-
-
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	public TypeInfo getType() throws SPLException {
-		// TODO Auto-generated method stub
-		return new TypeInfo(TypeConstants.booleanType,null,false);
-	}
-
-	public boolean isArray() {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	public boolean validate() throws SPLException {
-		// TODO Auto-generated method stub
-		return true;
-	}
-
-	
-
-}
+/*
+ * 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.
+ */
+/**/
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.javaspl.samples.userdefinedmethods;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public class CommandLineExecution implements Expression 
+{
+
+	private List inputParams =null;
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+
+	public CommandLineExecution(List input, boolean boo)
+	{
+		System.out.println(" creating sendMail action");
+		this.inputParams=input;
+	}
+	public Object evaluate() throws SPLException 
+	{
+		
+		Expression commandExpression=(Expression)this.inputParams.get(0);
+		Object command=commandExpression.evaluate();
+		System.out.println("command :"+command);
+
+		Runtime runtime=Runtime.getRuntime();
+		try{
+			runtime.exec((String)command);
+			System.out.println("command execution completed :"+command);
+			System.out.println("");
+
+			
+		}
+		catch(IOException e){
+			logger.severe(Thread.currentThread().getName()+" "+e.getMessage());
+            e.printStackTrace();
+		}
+		
+		return new Boolean(true);
+	}
+
+
+
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public TypeInfo getType() throws SPLException {
+		// TODO Auto-generated method stub
+		return new TypeInfo(TypeConstants.booleanType,null,false);
+	}
+
+	public boolean isArray() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean validate() throws SPLException {
+		// TODO Auto-generated method stub
+		return true;
+	}
+
+	
+
+}

Propchange: incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/CommandLineExecution.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/SendMail.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/SendMail.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/SendMail.java
(original)
+++ incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/SendMail.java
Fri Jan 11 10:56:30 2008
@@ -1,190 +1,190 @@
-/*
- * 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.
- */
-/**/
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.javaspl.samples.userdefinedmethods;
-
-import java.util.List;
-import java.util.Properties;
-import java.util.logging.Logger;
-import javax.mail.Authenticator;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.PasswordAuthentication;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public class SendMail implements Expression 
-{
-
-	private List inputParams =null;
-	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-
-	public SendMail(List input, boolean boo)
-	{
-		//System.out.println(" creating sendMail action");
-		this.inputParams=input;
-	}
-	public Object evaluate() throws SPLException 
-	{
-		
-		Expression fromExpression=(Expression)this.inputParams.get(0);
-		Object from=fromExpression.evaluate();
-		System.out.println("from :"+from);
-
-
-		Expression toExpression=(Expression)this.inputParams.get(1);
-		Object to=toExpression.evaluate();
-		System.out.println("to :"+to);
-
-
-		Expression subjectExpression=(Expression)this.inputParams.get(2);
-		Object subject=subjectExpression.evaluate();
-		System.out.println("subject :"+subject);
-
-
-		Expression messageExpression=(Expression)this.inputParams.get(3);
-		Object message=messageExpression.evaluate();
-		System.out.println("message :"+message);
-
-		try {
-			//System.out.println("trying to send mail");
-
-			//System.out.println("trying to create service object ");
-	        
-			boolean ret=postMail((String)from,(String)to,(String)subject,(String)message);
-	        System.out.println("Sent mail, return value='" + ret + "'");
-	        System.out.println("");
-	      } catch (Exception e) {
-	    	  System.out.println("send mail exception block");
-	    	  logger.severe(Thread.currentThread().getName()+" "+e.getMessage());
-	            
-	    	  e.printStackTrace();
-	        System.out.println(e.toString());
-	      }
-		 
-		// TODO Auto-generated method stub
-		return new Boolean(true);
-	}
-
-
-	public boolean postMail( String from,String recipients, String subject,
-			String message) throws MessagingException
-			{
-		//System.out.println("post mail");
-		 String JAVAX_MAIL_PROTOCOL = "smtp";
-		   String SMTP_HOST_NAME = "relay.de.ibm.com";
-//		   String SMTP_AUTH_USER = "anonymous";
-//		   String SMTP_AUTH_PWD  = "anonymous";
-		   String SMTP_AUTH_ENABLED  = "false";
-//		   int SEVERITY = 50;
-//		   int NO_ACTION_SEVERITY = 50;
-		  
-		boolean debug = false;
-//		Set the host smtp address
-		Properties props = new Properties();
-		props.put( "mail.transport.protocol", JAVAX_MAIL_PROTOCOL);
-		props.put("mail.smtp.host", SMTP_HOST_NAME);
-		Session session = null;
-		//System.out.println("post mail1");
-		if(SMTP_AUTH_ENABLED.equals("true"))
-		{
-			props.put("mail.smtp.auth", "true");
-			Authenticator auth = new SMTPAuthenticator();
-			session = Session.getDefaultInstance(props, auth);
-			//System.out.println("post mail2");
-		}
-		else 
-			session = Session.getDefaultInstance(props);
-		//System.out.println("post mail3");
-		session.setDebug(debug);
-
-//		create a message
-		Message msg = new MimeMessage(session);
-		//System.out.println("post mail4");
-		msg.setFrom(new InternetAddress(from));
-		//System.out.println("post mail5");
-		msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse( recipients ));
-		//System.out.println("post mail6");
-
-//		Setting the Subject and Content Type
-		msg.setSubject(subject);
-		msg.setContent(message, "text/plain");
-		//System.out.println("post mail7");
-		try{
-			//System.out.println("post mail8");
-			Transport.send(msg);
-			//System.out.println("post mail9");
-		}catch(Exception e)
-		{
-			e.printStackTrace();
-			
-		}
-		
-		//System.out.println("messsage sent");
-		return true;
-		}
-
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	public TypeInfo getType() throws SPLException {
-		// TODO Auto-generated method stub
-		return new TypeInfo(TypeConstants.booleanType,null,false);
-	}
-
-	public boolean isArray() {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	public boolean validate() throws SPLException {
-		// TODO Auto-generated method stub
-		return true;
-	}
-
-	
-	
-	private class SMTPAuthenticator extends javax.mail.Authenticator
-	{
-	    public PasswordAuthentication getPasswordAuthentication()
-	    {
-	    	 String SMTP_AUTH_USER = "anonymous";
-	    	  String SMTP_AUTH_PWD  = "anonymous";
-	    	  
-	        String username = SMTP_AUTH_USER;
-	        String password = SMTP_AUTH_PWD;
-	        return new PasswordAuthentication(username, password);
-	    }
-	}
-}
+/*
+ * 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.
+ */
+/**/
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.javaspl.samples.userdefinedmethods;
+
+import java.util.List;
+import java.util.Properties;
+import java.util.logging.Logger;
+import javax.mail.Authenticator;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.PasswordAuthentication;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public class SendMail implements Expression 
+{
+
+	private List inputParams =null;
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+
+	public SendMail(List input, boolean boo)
+	{
+		//System.out.println(" creating sendMail action");
+		this.inputParams=input;
+	}
+	public Object evaluate() throws SPLException 
+	{
+		
+		Expression fromExpression=(Expression)this.inputParams.get(0);
+		Object from=fromExpression.evaluate();
+		System.out.println("from :"+from);
+
+
+		Expression toExpression=(Expression)this.inputParams.get(1);
+		Object to=toExpression.evaluate();
+		System.out.println("to :"+to);
+
+
+		Expression subjectExpression=(Expression)this.inputParams.get(2);
+		Object subject=subjectExpression.evaluate();
+		System.out.println("subject :"+subject);
+
+
+		Expression messageExpression=(Expression)this.inputParams.get(3);
+		Object message=messageExpression.evaluate();
+		System.out.println("message :"+message);
+
+		try {
+			//System.out.println("trying to send mail");
+
+			//System.out.println("trying to create service object ");
+	        
+			boolean ret=postMail((String)from,(String)to,(String)subject,(String)message);
+	        System.out.println("Sent mail, return value='" + ret + "'");
+	        System.out.println("");
+	      } catch (Exception e) {
+	    	  System.out.println("send mail exception block");
+	    	  logger.severe(Thread.currentThread().getName()+" "+e.getMessage());
+	            
+	    	  e.printStackTrace();
+	        System.out.println(e.toString());
+	      }
+		 
+		// TODO Auto-generated method stub
+		return new Boolean(true);
+	}
+
+
+	public boolean postMail( String from,String recipients, String subject,
+			String message) throws MessagingException
+			{
+		//System.out.println("post mail");
+		 String JAVAX_MAIL_PROTOCOL = "smtp";
+		   String SMTP_HOST_NAME = "relay.de.ibm.com";
+//		   String SMTP_AUTH_USER = "anonymous";
+//		   String SMTP_AUTH_PWD  = "anonymous";
+		   String SMTP_AUTH_ENABLED  = "false";
+//		   int SEVERITY = 50;
+//		   int NO_ACTION_SEVERITY = 50;
+		  
+		boolean debug = false;
+//		Set the host smtp address
+		Properties props = new Properties();
+		props.put( "mail.transport.protocol", JAVAX_MAIL_PROTOCOL);
+		props.put("mail.smtp.host", SMTP_HOST_NAME);
+		Session session = null;
+		//System.out.println("post mail1");
+		if(SMTP_AUTH_ENABLED.equals("true"))
+		{
+			props.put("mail.smtp.auth", "true");
+			Authenticator auth = new SMTPAuthenticator();
+			session = Session.getDefaultInstance(props, auth);
+			//System.out.println("post mail2");
+		}
+		else 
+			session = Session.getDefaultInstance(props);
+		//System.out.println("post mail3");
+		session.setDebug(debug);
+
+//		create a message
+		Message msg = new MimeMessage(session);
+		//System.out.println("post mail4");
+		msg.setFrom(new InternetAddress(from));
+		//System.out.println("post mail5");
+		msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse( recipients ));
+		//System.out.println("post mail6");
+
+//		Setting the Subject and Content Type
+		msg.setSubject(subject);
+		msg.setContent(message, "text/plain");
+		//System.out.println("post mail7");
+		try{
+			//System.out.println("post mail8");
+			Transport.send(msg);
+			//System.out.println("post mail9");
+		}catch(Exception e)
+		{
+			e.printStackTrace();
+			
+		}
+		
+		//System.out.println("messsage sent");
+		return true;
+		}
+
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public TypeInfo getType() throws SPLException {
+		// TODO Auto-generated method stub
+		return new TypeInfo(TypeConstants.booleanType,null,false);
+	}
+
+	public boolean isArray() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean validate() throws SPLException {
+		// TODO Auto-generated method stub
+		return true;
+	}
+
+	
+	
+	private class SMTPAuthenticator extends javax.mail.Authenticator
+	{
+	    public PasswordAuthentication getPasswordAuthentication()
+	    {
+	    	 String SMTP_AUTH_USER = "anonymous";
+	    	  String SMTP_AUTH_PWD  = "anonymous";
+	    	  
+	        String username = SMTP_AUTH_USER;
+	        String password = SMTP_AUTH_PWD;
+	        return new PasswordAuthentication(username, password);
+	    }
+	}
+}

Propchange: incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/userdefinedmethods/SendMail.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/pom.xml?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/pom.xml (original)
+++ incubator/imperius/trunk/pom.xml Fri Jan 11 10:56:30 2008
@@ -1,55 +1,55 @@
-<!--
- * Copyright 2004 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.
- */ -->
-<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>
-	<groupId>imperius</groupId>
-	<artifactId>build-all</artifactId>
-	<version>1.0.0-SNAPSHOT</version>
-	<name>Apache imperius</name>
-	<url>http://ws.apache.org/imperius</url>
-	<prerequisites>
-		<maven>2.0.4</maven>
-	</prerequisites>
-	<packaging>pom</packaging>
-	
-	<properties>
-		<imperius-version>1.0.0-SNAPSHOT</imperius-version>
-	</properties>
-	<modules>
-		<module>imperius-splcore</module>
-		<module>imperius-javaspl</module>
-		<module>javaspl-samples</module>
-	</modules>
-	
-	<build>
-		<defaultGoal>install</defaultGoal>
-		<sourceDirectory>src</sourceDirectory>
-		<resources>
-			<resource>
-				<directory>src</directory>
-				<includes>
-					<include>**/*.properties</include>
-				</includes>
-			</resource>
-			<resource>
-				<directory>resources</directory>
-				<targetPath>resources</targetPath>
-			</resource>
-		</resources>
-	</build>
-	
-</project>
+<!--
+ * Copyright 2004 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.
+ */ -->
+<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>
+	<groupId>imperius</groupId>
+	<artifactId>build-all</artifactId>
+	<version>1.0.0-SNAPSHOT</version>
+	<name>Apache imperius</name>
+	<url>http://ws.apache.org/imperius</url>
+	<prerequisites>
+		<maven>2.0.4</maven>
+	</prerequisites>
+	<packaging>pom</packaging>
+	
+	<properties>
+		<imperius-version>1.0.0-SNAPSHOT</imperius-version>
+	</properties>
+	<modules>
+		<module>imperius-splcore</module>
+		<module>imperius-javaspl</module>
+		<module>javaspl-samples</module>
+	</modules>
+	
+	<build>
+		<defaultGoal>install</defaultGoal>
+		<sourceDirectory>src</sourceDirectory>
+		<resources>
+			<resource>
+				<directory>src</directory>
+				<includes>
+					<include>**/*.properties</include>
+				</includes>
+			</resource>
+			<resource>
+				<directory>resources</directory>
+				<targetPath>resources</targetPath>
+			</resource>
+		</resources>
+	</build>
+	
+</project>

Propchange: incubator/imperius/trunk/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message