axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r542211 [2/3] - in /webservices/axis2/trunk/java: ./ modules/adb-codegen/test-resources/testsuite/ modules/adb/ modules/adb/src/org/apache/axis2/databinding/utils/ modules/adb/src/org/apache/axis2/databinding/utils/reader/ modules/codegen/s...
Date Mon, 28 May 2007 11:47:41 GMT
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EMailSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EMailSender.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EMailSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EMailSender.java Mon May 28 04:47:38 2007
@@ -22,9 +22,14 @@
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.client.Options;
+import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.OutOnlyAxisOperation;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -32,21 +37,14 @@
 import javax.activation.DataHandler;
 import javax.activation.DataSource;
 import javax.activation.MailcapCommandMap;
-import javax.mail.Authenticator;
-import javax.mail.BodyPart;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.Multipart;
-import javax.mail.Part;
-import javax.mail.PasswordAuthentication;
-import javax.mail.Session;
-import javax.mail.Transport;
+import javax.mail.*;
 import javax.mail.internet.AddressException;
 import javax.mail.internet.InternetAddress;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
+import java.util.Hashtable;
 import java.util.Properties;
 
 public class EMailSender {
@@ -105,7 +103,7 @@
 
 
             EndpointReference epr = null;
-            MailToInfo mailToInfo = null;
+            MailToInfo mailToInfo;
 
             if (messageContext.getTo() != null && !messageContext.getTo().hasAnonymousAddress()) {
                 epr = messageContext.getTo();
@@ -115,40 +113,40 @@
                 if (!epr.hasNoneAddress()) {
                     mailToInfo = new MailToInfo(epr);
                     msg.addRecipient(Message.RecipientType.TO,
-                                     new InternetAddress(mailToInfo.getEmailAddress()));
+                            new InternetAddress(mailToInfo.getEmailAddress()));
 
                 } else {
                     if (from != null) {
                         mailToInfo = new MailToInfo(from);
-                         msg.addRecipient(Message.RecipientType.TO,
-                                         new InternetAddress(mailToInfo.getEmailAddress()));
+                        msg.addRecipient(Message.RecipientType.TO,
+                                new InternetAddress(mailToInfo.getEmailAddress()));
                     } else {
                         String error = EMailSender.class.getName() + "Couldn't countinue due to" +
-                                       " FROM addressing is NULL";
+                                " FROM addressing is NULL";
                         log.error(error);
                         throw new AxisFault(error);
                     }
                 }
             } else {
                 // replyto : from : or reply-path;
-                    if (from != null) {
+                if (from != null) {
                     mailToInfo = new MailToInfo(from);
-                        msg.addRecipient(Message.RecipientType.TO,
-                                     new InternetAddress(mailToInfo.getEmailAddress()));
-                    } else {
-                        String error = EMailSender.class.getName() + "Couldn't countinue due to" +
-                                       " FROM addressing is NULL and EPR is NULL";
-                        log.error(error);
-                        throw new AxisFault(error);
-                    }
-
+                    msg.addRecipient(Message.RecipientType.TO,
+                            new InternetAddress(mailToInfo.getEmailAddress()));
+                } else {
+                    String error = EMailSender.class.getName() + "Couldn't countinue due to" +
+                            " FROM addressing is NULL and EPR is NULL";
+                    log.error(error);
+                    throw new AxisFault(error);
                 }
 
+            }
+
             msg.setSubject("__ Axis2/Java Mail Message __");
 
             if (mailToInfo.isxServicePath()) {
                 msg.setHeader(Constants.X_SERVICE_PATH,
-                              "\"" + mailToInfo.getContentDescription() + "\"");
+                        "\"" + mailToInfo.getContentDescription() + "\"");
             }
 
             if (inReplyTo != null) {
@@ -158,11 +156,13 @@
             createMailMimeMessage(msg, mailToInfo, format);
             Transport.send(msg);
 
+            log.info("Message being send. [Action = ]" + messageContext.getOptions().getAction());
+
             sendReceive(messageContext, msg.getMessageID());
         } catch (AddressException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         } catch (MessagingException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 
@@ -190,24 +190,24 @@
                 .addHeader("Content-Description", "\"" + mailToInfo.getContentDescription() + "\"");
 
         String contentType = format.getContentType() != null ? format.getContentType() :
-                             Constants.DEFAULT_CONTENT_TYPE;
+                Constants.DEFAULT_CONTENT_TYPE;
         if (contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
             if (messageContext.getSoapAction() != null) {
                 messageBodyPart.setHeader(Constants.HEADER_SOAP_ACTION,
-                                          messageContext.getSoapAction());
+                        messageContext.getSoapAction());
             }
         }
 
         if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
             if (messageContext.getSoapAction() != null) {
                 messageBodyPart.setHeader("Content-Type",
-                                          contentType + "; charset=" + format.getCharSetEncoding() +
-                                          " ; action=\"" + messageContext.getSoapAction() +
-                                          "\"");
+                        contentType + "; charset=" + format.getCharSetEncoding() +
+                                " ; action=\"" + messageContext.getSoapAction() +
+                                "\"");
             }
         } else {
             messageBodyPart.setHeader("Content-Type",
-                                      contentType + "; charset=" + format.getCharSetEncoding());
+                    contentType + "; charset=" + format.getCharSetEncoding());
         }
 
         multipart.addBodyPart(messageBodyPart);
@@ -229,15 +229,56 @@
     }
 
     private void sendReceive(MessageContext msgContext, String msgId) throws AxisFault {
-        Object obj = msgContext.getProperty(Constants.MAIL_SYNC);
-        if (obj == null) {
+        storeMessageContext(msgContext, msgId);
+        ConfigurationContext cc = msgContext.getConfigurationContext();
+        //While sysncmial listner .not complete
+        Options options = msgContext.getOptions();
+        long outInMilliSeconds = options.getTimeOutInMilliSeconds();
+        SynchronousMailListener synchronousMailListener = null;
+        //No need to stor the message context if the mep is out-only
+        AxisOperation axisOperation = msgContext.getAxisOperation();
+        if(axisOperation instanceof OutOnlyAxisOperation) {
             return;
         }
 
-        Options options = msgContext.getOptions();
+        if (!options.isUseSeparateListener() && !msgContext.isServerSide()) {
+            if(!cc.getListenerManager().isListenerRunning(Constants.MAILTO)){
+                TransportInDescription mailTo=
+                        cc.getAxisConfiguration().getTransportIn(Constants.MAILTO);
+                if(mailTo==null){
+                    throw new AxisFault("Could not found transport for " +Constants.MAILTO );
+                }
+                cc.getListenerManager().addListener(mailTo,false);
+            }
+            Hashtable callBackTable = (Hashtable) cc.getProperty(Constants.CALLBACK_TABLE);
+
+            if(callBackTable!=null){
+                synchronousMailListener =
+                        new SynchronousMailListener(messageContext, outInMilliSeconds);
+                callBackTable.put(msgId,synchronousMailListener);
+            }
+            while(!synchronousMailListener.isComplete()){
+                try {
+                    Thread.sleep(6000);
+                } catch (InterruptedException e) {
+                    throw new AxisFault(e.getMessage(),e);
+                }
+            }
+            callBackTable.remove(msgId);
+        }
+    }
+
+    private void storeMessageContext(MessageContext msgContext, String msgId) {
+        Hashtable mappingTable = (Hashtable) msgContext.getConfigurationContext().
+                getProperty(Constants.MAPPING_TABLE);
+
+        if (mappingTable == null) {
+            mappingTable = new Hashtable();
+            msgContext.setProperty(Constants.MAPPING_TABLE, mappingTable);
+        }
+        if (msgContext.getMessageID() != null) {
+            mappingTable.put(msgId, msgContext.getMessageID());
+        }
 
-        SynchronousMailListener listener =
-                new SynchronousMailListener(options.getTimeOutInMilliSeconds());
-        listener.sendReceive(msgContext, msgId);
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EmailReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EmailReceiver.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EmailReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EmailReceiver.java Mon May 28 04:47:38 2007
@@ -60,9 +60,9 @@
 
             folder = folder.getFolder("inbox");
         } catch (NoSuchProviderException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         } catch (MessagingException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 
@@ -71,7 +71,7 @@
             folder.close(true);
             store.close();
         } catch (MessagingException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 
@@ -87,9 +87,9 @@
                 return msgs;
             }
         } catch (NoSuchProviderException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         } catch (MessagingException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailTransportSender.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailTransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailTransportSender.java Mon May 28 04:47:38 2007
@@ -217,7 +217,7 @@
             sender.send();
 
         } catch (IOException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 
@@ -232,7 +232,7 @@
             messageFormatter.writeTo(msgContext, format, out, false);
             out.flush();
         } catch (Exception e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorker.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorker.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorker.java Mon May 28 04:47:38 2007
@@ -25,17 +25,15 @@
 
 public class MailWorker implements Runnable {
     private ConfigurationContext configContext = null;
-    private LinkedBlockingQueue messageQueue;
+    private MessageContext messageContext;
 
     /**
      * Constructor for MailWorker
      *
-     * @param messageQueue
-     * @param reg
      */
-    public MailWorker(ConfigurationContext reg, LinkedBlockingQueue messageQueue) {
+    public MailWorker(ConfigurationContext reg, MessageContext messageContext) {
         this.configContext = reg;
-        this.messageQueue = messageQueue;
+        this.messageContext = messageContext;
     }
 
     /**
@@ -43,22 +41,18 @@
      */
     public void run() {
         AxisEngine engine = new AxisEngine(configContext);
-        MessageContext msgContext = null;
         // create and initialize a message context
-        while (true) {
+        try {
+            engine.receive(messageContext);
+        } catch (Exception e) {
             try {
-                msgContext = (MessageContext) messageQueue.take();
-                engine.receive(msgContext);
-            } catch (Exception e) {
-                try {
-                    if (msgContext != null) {
-                        MessageContext faultContext =
-                                MessageContextBuilder.createFaultMessageContext(msgContext, e);
-                        engine.sendFault(faultContext);
-                    }
-                } catch (Exception e1) {
-                    // Ignore errors that would possibly happen this catch
+                if (messageContext != null&&!messageContext.isServerSide()) {
+                    MessageContext faultContext =
+                            MessageContextBuilder.createFaultMessageContext(messageContext, e);
+                    engine.sendFault(faultContext);
                 }
+            } catch (Exception e1) {
+                // Ignore errors that would possibly happen this catch
             }
         }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorkerManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorkerManager.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorkerManager.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorkerManager.java Mon May 28 04:47:38 2007
@@ -43,7 +43,7 @@
 
     public void start() throws AxisFault {
         for (int i = 0; i < poolSize; i++) {
-            workerPool.execute(new MailWorker(configurationContext, messageQueue));
+//            workerPool.execute(new MailWorker(configurationContext, messageQueue));
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java Mon May 28 04:47:38 2007
@@ -18,25 +18,21 @@
 package org.apache.axis2.transport.mail;
 
 import edu.emory.mathcs.backport.java.util.concurrent.ExecutorService;
-import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
-import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
 import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.builder.BuilderUtil;
 import org.apache.axis2.context.*;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.description.TransportOutDescription;
+import org.apache.axis2.description.*;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.transport.TransportListener;
 import org.apache.axis2.transport.TransportUtils;
 import org.apache.axis2.util.Utils;
-import org.apache.axis2.util.threadpool.DefaultThreadFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -49,6 +45,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Properties;
+import java.util.Hashtable;
 
 /**
  * This is the implementation for Mail Listener in Axis2. It has the full capability
@@ -70,7 +67,7 @@
     /*This hold properties for pop3 or impa server connection*/
     private Properties pop3Properties = new Properties();
 
-    private EmailReceiver receiver = null;
+    private final EmailReceiver receiver ;
 
     /**
      * Time has been put from best guest. Let the default be 3 mins.
@@ -80,24 +77,8 @@
      */
     private int listenerWaitInterval = 1000 * 60 * 3;
 
-    private ExecutorService workerPool;
-
-    private static final int WORKERS_MAX_THREADS = 5;
-    private static final long WORKER_KEEP_ALIVE = 60L;
-    private static final TimeUnit TIME_UNIT = TimeUnit.SECONDS;
-
-    private LinkedBlockingQueue messageQueue;
-
     public SimpleMailListener() {
-    }
-
-    /**
-     * This constructor will be used in when Mail simulate the request/response
-     *
-     * @param messageQueue
-     */
-    public SimpleMailListener(LinkedBlockingQueue messageQueue) {
-        this.messageQueue = messageQueue;
+          receiver = new EmailReceiver();
     }
 
     public void init(ConfigurationContext configurationContext, TransportInDescription transportIn)
@@ -162,9 +143,21 @@
             urlName = new URLName(protocol, host, Integer.parseInt(port), "", user, password);
         }
 
-        receiver = new EmailReceiver();
         receiver.setPop3Properties(pop3Properties);
         receiver.setUrlName(urlName);
+        Object obj = configurationContext.
+                getProperty(org.apache.axis2.transport.mail.Constants.MAPPING_TABLE);
+        if (obj == null) {
+            configurationContext.setProperty(
+                    org.apache.axis2.transport.mail.Constants.MAPPING_TABLE, new Hashtable());
+        }
+
+        Object callBackTable = configurationContext.
+                getProperty(org.apache.axis2.transport.mail.Constants.CALLBACK_TABLE);
+        if (callBackTable == null) {
+            configurationContext.setProperty(
+                    org.apache.axis2.transport.mail.Constants.CALLBACK_TABLE, new Hashtable());
+        }
 
 
     }
@@ -208,9 +201,20 @@
             urlName = new URLName(protocol, host, Integer.parseInt(port), "", user, password);
         }
 
-        receiver = new EmailReceiver();
         receiver.setPop3Properties(pop3Properties);
         receiver.setUrlName(urlName);
+        Object obj = configurationContext.
+                getProperty(org.apache.axis2.transport.mail.Constants.MAPPING_TABLE);
+        if (obj == null) {
+            configurationContext.setProperty(
+                    org.apache.axis2.transport.mail.Constants.MAPPING_TABLE, new Hashtable());
+        }
+        Object callBackTable = configurationContext.
+                getProperty(org.apache.axis2.transport.mail.Constants.CALLBACK_TABLE);
+        if (callBackTable == null) {
+            configurationContext.setProperty(
+                    org.apache.axis2.transport.mail.Constants.CALLBACK_TABLE, new Hashtable());
+        }
     }
 
     /**
@@ -265,34 +269,39 @@
         }
 
         while (running) {
+            log.info("Info started polling");
             try {
-                receiver.connect();
+                synchronized (receiver) {
+                    receiver.connect();
 
-                Message[] msgs = receiver.receiveMessages();
+                    Message[] msgs = receiver.receiveMessages();
 
-                if ((msgs != null) && (msgs.length > 0)) {
-                    log.info(msgs.length + " Message Found");
+                    if ((msgs != null) && (msgs.length > 0)) {
+                        log.info(msgs.length + " Message(s) Found");
 
-                    for (int i = 0; i < msgs.length; i++) {
-                        MimeMessage msg = (MimeMessage) msgs[i];
-                        try {
-                            MessageContext mc = createMessageContextToMailWorker(msg);
-                            if (mc != null) {
-                                messageQueue.add(mc);
+                        for (int i = 0; i < msgs.length; i++) {
+                            MimeMessage msg = (MimeMessage) msgs[i];
+                            try {
+                                MessageContext mc = createMessageContextToMailWorker(msg);
+                                if(mc==null){
+                                    continue;
+                                }
+                                msg.setFlag(Flags.Flag.DELETED, true);
+                                MailWorker worker = new MailWorker(configurationContext,mc);
+                                this.configurationContext.getThreadPool().execute(worker);
+                            } catch (Exception e) {
+                                log.error("Error in SimpleMailListener - processing mail", e);
+                            } finally {
+                                // delete mail in any case
                             }
-                        } catch (Exception e) {
-                            log.error("Error in SimpleMailListener - processing mail " + e);
-                        } finally {
-                            // delete mail in any case
-                            msg.setFlag(Flags.Flag.DELETED, true);
                         }
                     }
-                }
 
-                receiver.disconnect();
+                    receiver.disconnect();
+                }
 
             } catch (Exception e) {
-                log.error("Error in SimpleMailListener" + e);
+                log.error("Error in SimpleMailListener", e);
             } finally {
                 try {
                     Thread.sleep(listenerWaitInterval);
@@ -305,7 +314,10 @@
     }
 
     private MessageContext createMessageContextToMailWorker(MimeMessage msg) throws Exception {
-
+        Object content = msg.getContent();
+        if(!(content instanceof Multipart)){
+            return null;
+        }
         MessageContext msgContext = null;
         TransportInDescription transportIn =
                 configurationContext.getAxisConfiguration()
@@ -345,10 +357,46 @@
             msgContext.setProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO, transportInfo);
 
             buildSOAPEnvelope(msg, msgContext);
+            if(!fillMessageContextFromAvaiableData(msgContext,inReplyTo)){
+                return null;
+            }
         }
         return msgContext;
     }
 
+    private boolean fillMessageContextFromAvaiableData(MessageContext msgContext ,
+                                                    String messageID) throws AxisFault{
+        Hashtable mappingTable = (Hashtable) configurationContext.
+                getProperty(org.apache.axis2.transport.mail.Constants.MAPPING_TABLE);
+
+        if(mappingTable!=null&&messageID!=null){
+            String messageConetextId= (String) mappingTable.get(messageID);
+            if(messageConetextId!=null){
+                OperationContext opContext = configurationContext.getOperationContext(messageConetextId);
+                if(opContext!=null && !opContext.isComplete()){
+                    AxisOperation axisOp = opContext.getAxisOperation();
+                    //TODO need to handle fault case as well ,
+                    //TODO  need to check whether the message contains fault , if so we need to get the fault message
+                    AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+                    msgContext.setOperationContext(opContext);
+                    msgContext.setAxisMessage(inMessage);
+                    opContext.addMessageContext(msgContext);
+                    msgContext.setServiceContext(opContext.getServiceContext());
+                }
+            }
+        }
+        Hashtable callBackTable = (Hashtable) configurationContext.getProperty(
+                org.apache.axis2.transport.mail.Constants.CALLBACK_TABLE);
+        if(messageID!=null&&callBackTable!=null){
+            SynchronousMailListener listener = (SynchronousMailListener) callBackTable.get(messageID);
+            if(listener!=null){
+                listener.setInMessageContext(msgContext);
+                return false;
+            }
+        }
+        return true;
+    }
+
     private void buildSOAPEnvelope(MimeMessage msg, MessageContext msgContext)
             throws AxisFault {
         //TODO we assume for the time being that there is only one attachement and this attachement contains  the soap evelope
@@ -404,12 +452,12 @@
 
             }
         } catch (IOException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
         catch (MessagingException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         } catch (XMLStreamException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 
@@ -418,26 +466,36 @@
             String values[] = msg.getHeader(headerName);
 
             if (values != null) {
-                return values[0];
+                return parseHeaderForQuotes(values[0]);
             } else {
                 return null;
             }
         } catch (MessagingException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 
+    private String parseHeaderForQuotes(String value) {
+        if (value != null) {
+            if (value.length() > 1 && value.startsWith("\"") && value.endsWith("\"")) {
+                value = value.substring(1, value.length() - 1);
+            }
+
+        }
+        return value;
+    }
+
     private String getMailHeaderFromPart(Part part, String headerName) throws AxisFault {
         try {
             String values[] = part.getHeader(headerName);
 
             if (values != null) {
-                return values[0];
+                return parseHeaderForQuotes(values[0]);
             } else {
                 return null;
             }
         } catch (MessagingException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 
@@ -445,21 +503,7 @@
      * Start this listener
      */
     public void start() throws AxisFault {
-        workerPool = new ThreadPoolExecutor(1,
-                                            WORKERS_MAX_THREADS, WORKER_KEEP_ALIVE, TIME_UNIT,
-                                            new LinkedBlockingQueue(),
-                                            new DefaultThreadFactory(
-                                                    new ThreadGroup("Mail Worker thread group"),
-                                                    "MailWorker"));
-
-        messageQueue = new LinkedBlockingQueue();
-
         this.configurationContext.getThreadPool().execute(this);
-
-        MailWorkerManager mailWorkerManager = new MailWorkerManager(configurationContext,
-                                                                    messageQueue, workerPool,
-                                                                    WORKERS_MAX_THREADS);
-        mailWorkerManager.start();
     }
 
     /**
@@ -467,10 +511,7 @@
      * <p/>
      */
     public void stop() {
-        running = true;
-        if (!workerPool.isShutdown()) {
-            workerPool.shutdown();
-        }
+        running = false;
         log.info("Stopping the mail listner");
     }
 
@@ -482,12 +523,13 @@
     public EndpointReference[] getEPRsForService(String serviceName, String ip) throws AxisFault {
         return new EndpointReference[]{
                 new EndpointReference(Constants.TRANSPORT_MAIL + ":" + replyTo + "?" +
-                                      configurationContext.getServiceContextPath() + "/" +
-                                      serviceName),
-                new EndpointReference(Constants.TRANSPORT_MAIL + ":" + replyTo + "?" +
                                       org.apache.axis2.transport.mail.Constants.X_SERVICE_PATH + "="
                                       + configurationContext.getServiceContextPath() + "/" +
-                                      serviceName)};
+                                      serviceName),
+                new EndpointReference(Constants.TRANSPORT_MAIL + ":" + replyTo + "?" +
+                                      configurationContext.getServiceContextPath() + "/" +
+                                      serviceName)
+                };
     }
 
 
@@ -497,9 +539,5 @@
 
     public void destroy() {
         this.configurationContext = null;
-    }
-
-    public LinkedBlockingQueue getLinkedBlockingQueue() {
-        return messageQueue;
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SynchronousMailListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SynchronousMailListener.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SynchronousMailListener.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SynchronousMailListener.java Mon May 28 04:47:38 2007
@@ -15,87 +15,68 @@
  */
 package org.apache.axis2.transport.mail;
 
-import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.Properties;
-/*
- * 
- */
-
 public class SynchronousMailListener {
 
     private static Log log = LogFactory.getLog(SynchronousMailListener.class);
+    private boolean complete = false;
+    //To store out going messageconext
+    private MessageContext outMessageContext;
+    private MessageContext inMessageContext;
 
     private long timeoutInMilliseconds = -1;
 
-    public SynchronousMailListener(long timeoutInMilliseconds) {
+
+    public SynchronousMailListener(MessageContext outMessageContext,
+                                   long timeoutInMilliseconds) {
+        this.outMessageContext = outMessageContext;
         this.timeoutInMilliseconds = timeoutInMilliseconds;
     }
 
-
-    public void sendReceive(final MessageContext msgContext, final String msgId) throws AxisFault {
-        /**
-         * This will be bloked invocation
-         */
-        SimpleMailListener listener = new SimpleMailListener(new LinkedBlockingQueue()) {
-            public void start() throws AxisFault {
-                long timeStatus;
-                LinkedBlockingQueue queue = getLinkedBlockingQueue();
-                while (true) {
-                    long startTime = System.currentTimeMillis();
-                    try {
-                        MessageContext msgCtx = (MessageContext) queue.take();
-                        MailBasedOutTransportInfo transportInfo = (MailBasedOutTransportInfo) msgCtx
-                                .getProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO);
-                        if (transportInfo.getInReplyTo() == null) {
-                            String error = EMailSender.class.getName() +" Coudn't simulate request/response without In-Reply-To Mail header";
-                            log.error(error);
-                            throw new AxisFault(error);
-                        }
-                        if (transportInfo.getInReplyTo().equals(msgId)) {
-                            msgContext.getOperationContext()
-                                    .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE)
-                                    .setEnvelope(msgCtx.getEnvelope());
-                            log.info(SynchronousMailListener.class.getName() + " found the required message.");
-                            break;
-                        }
-
-                    } catch (InterruptedException e) {
-                        log.warn(e);
-                        throw AxisFault.makeFault(e);
-                    }
-                    long endTime = System.currentTimeMillis();
-                    timeStatus = endTime - startTime;
-                    if (timeoutInMilliseconds != -1 && timeStatus > timeoutInMilliseconds) {
-                        /*TODO What should be the best default value for timeoutInMilliseconds ?*/
-                        /*log.info(SynchronousMailListener.class.getName() + " timeout");
-                        break;*/
-                    }
-
-                }
-
-
+    public void setInMessageContext(MessageContext inMessageContext) throws AxisFault{
+        OperationContext operationContext = outMessageContext.getOperationContext();
+        MessageContext msgCtx =
+                operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+        if(msgCtx==null){
+            inMessageContext.setOperationContext(operationContext);
+            inMessageContext.setServiceContext(outMessageContext.getServiceContext());
+            if(!operationContext.isComplete()){
+                operationContext.addMessageContext(inMessageContext);
             }
-        };
-
-        TransportInDescription transportIn = msgContext.getConfigurationContext()
-                .getAxisConfiguration().getTransportIn(org.apache.axis2.Constants.TRANSPORT_MAIL);
-
-        Object obj = msgContext.getProperty(Constants.MAIL_POP3);
-        if (obj != null) {
-            listener.initFromRuntime((Properties)obj,msgContext);
+            AxisOperation axisOp = operationContext.getAxisOperation();
+            //TODO need to handle fault case as well ,
+            //TODO  need to check whether the message contains fault , if so we need to get the fault message
+            AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+            inMessageContext.setAxisMessage(inMessage);
+            inMessageContext.setServerSide(false);
         } else {
-            listener.init(msgContext.getConfigurationContext(), transportIn);
+            msgCtx.setOperationContext(operationContext);
+            msgCtx.setServiceContext(outMessageContext.getServiceContext());
+            AxisOperation axisOp = operationContext.getAxisOperation();
+            AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+            msgCtx.setAxisMessage(inMessage);
+            msgCtx.setTransportIn(inMessageContext.getTransportIn());
+            msgCtx.setTransportOut(inMessageContext.getTransportOut());
+            msgCtx.setServerSide(false);
+            msgCtx.setProperty(org.apache.axis2.transport.mail.Constants.CONTENT_TYPE,
+                    inMessageContext.getProperty(org.apache.axis2.transport.mail.Constants.CONTENT_TYPE));
+            msgCtx.setIncomingTransportName(org.apache.axis2.Constants.TRANSPORT_MAIL);
+            msgCtx.setEnvelope(inMessageContext.getEnvelope());
+            if(!operationContext.isComplete()){
+                operationContext.addMessageContext(msgCtx);
+            }
         }
-        msgContext.getConfigurationContext().getThreadPool().execute(listener);
-        listener.start();
-
+        this.inMessageContext = inMessageContext;
+        log.info(" SynchronousMailListener found the required message.");
+        complete = true;
     }
 
     public long getTimeoutInMilliseconds() {
@@ -104,5 +85,13 @@
 
     public void setTimeoutInMilliseconds(long timeoutInMilliseconds) {
         this.timeoutInMilliseconds = timeoutInMilliseconds;
+    }
+
+    public boolean isComplete() {
+        return complete;
+    }
+
+    public MessageContext getInMessageContext() {
+        return inMessageContext;
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/MailSorter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/MailSorter.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/MailSorter.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/MailSorter.java Mon May 28 04:47:38 2007
@@ -128,7 +128,8 @@
             SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
 
             msgContext.setEnvelope(envelope);
-            engine.receive(msgContext);
+
+            AxisEngine.receive(msgContext);
         } catch (Exception e) {
             try {
                 if (msgContext != null) {
@@ -165,7 +166,7 @@
                 return null;
             }
         } catch (MessagingException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/POP3Server.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/POP3Server.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/POP3Server.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/POP3Server.java Mon May 28 04:47:38 2007
@@ -38,7 +38,7 @@
                 log.info("Server started on port " + port);
             }
         } catch (IOException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 
@@ -61,7 +61,7 @@
                 serverSocket.close();
             }
         } catch (IOException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPServer.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPServer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPServer.java Mon May 28 04:47:38 2007
@@ -93,7 +93,7 @@
                 ss = null;
             }
         } catch (IOException e) {
-            throw AxisFault.makeFault(e);
+            throw new AxisFault(e.getMessage(),e);
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java Mon May 28 04:47:38 2007
@@ -23,6 +23,7 @@
 import org.apache.axis2.client.async.AsyncResult;
 import org.apache.axis2.client.async.Callback;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.engine.MessageReceiver;
 
 import java.util.HashMap;
@@ -65,7 +66,10 @@
             // check weather the result is a fault.
             SOAPEnvelope envelope = result.getResponseEnvelope();
             SOAPFault fault = envelope.getBody().getFault();
-
+            OperationContext opContext =messageCtx.getOperationContext();
+            if(opContext!=null&&!opContext.isComplete()){
+                opContext.addMessageContext(messageCtx);
+            }
             if (fault == null) {
                 // if there is not fault call the onComplete method
                 callback.onComplete(result);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java Mon May 28 04:47:38 2007
@@ -16,6 +16,16 @@
 
 package org.apache.axis2.util;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.description.AxisDescription;
 import org.apache.axis2.description.AxisMessage;
@@ -27,16 +37,10 @@
 import org.apache.neethi.PolicyComponent;
 import org.apache.neethi.PolicyEngine;
 import org.apache.neethi.PolicyReference;
+import org.apache.neethi.PolicyRegistry;
 import org.apache.woden.internal.util.dom.DOM2Writer;
 import org.w3c.dom.Element;
 
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-
 public class PolicyUtil {
 
     public static String getSafeString(String unsafeString) {
@@ -189,5 +193,31 @@
         }
 
         return identifier;
+    }
+    
+    
+    public static Policy getMergedPolicy(List policies, AxisDescription description) {
+        
+        Policy policy = null;
+        
+        for (Iterator iterator = policies.iterator(); iterator.hasNext(); ) {
+            Object policyElement = iterator.next()
+            ;
+            if (policyElement instanceof Policy) {
+                policy = (policy == null) ? (Policy) policyElement : (Policy) policy.merge((Policy) policyElement);
+                
+            } else {
+                PolicyReference policyReference = (PolicyReference) policyElement;
+                Policy policy2 = (Policy) policyReference.normalize(new AxisPolicyLocator(description), false);
+                policy = (policy == null) ? policy2 : (Policy) policy.merge(policy2);                 
+            }
+        }
+        
+        
+        if (policy != null) {
+            policy = (Policy) policy.normalize(new AxisPolicyLocator(description), false);            
+        }
+        
+        return policy;        
     }
 }

Modified: webservices/axis2/trunk/java/modules/parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/parent/pom.xml?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/parent/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/parent/pom.xml Mon May 28 04:47:38 2007
@@ -334,22 +334,22 @@
 			<organization>Lanka Software Foundation / University of Moratuwa</organization>
 		</contributor>
 	</contributors>
-	<repositories>
-	<!--
-	    Checking repositores takes lots of time.
-	    Repositories which should NOT be put in here.
-	    
-	     http://people.apache.org/repo/m2-snapshot-repository/
-	     	Exists in the org.apache.apache parent pom
-	     	
-	     http://repo1.maven.org/maven2/ aka 'Central'
-	     	Exists in the maven 'Super POM' which all poms extend
-	     	
-	     http://people.apache.org/repo/m2-ibiblio-rsync-repository/
-	     	Everything in here should be in 'Central'
-	     	
-	    Checksum policy when not specified always defaults to 'warn'
-	    which is what we want.
+	<repositories>
+	<!--
+	    Checking repositores takes lots of time.
+	    Repositories which should NOT be put in here.
+	    
+	     http://people.apache.org/repo/m2-snapshot-repository/
+	     	Exists in the org.apache.apache parent pom
+	     	
+	     http://repo1.maven.org/maven2/ aka 'Central'
+	     	Exists in the maven 'Super POM' which all poms extend
+	     	
+	     http://people.apache.org/repo/m2-ibiblio-rsync-repository/
+	     	Everything in here should be in 'Central'
+	     	
+	    Checksum policy when not specified always defaults to 'warn'
+	    which is what we want.
 	 -->
 		<repository>
 			<releases>
@@ -366,36 +366,36 @@
 		</repository>
 		<repository>
 			<id>tomcat-repository</id>
-			<url>http://tomcat.apache.org/dev/dist/m2-repository</url>
-			<releases>
-				<enabled>true</enabled>
-				<updatePolicy>always</updatePolicy>
-			</releases>
-			<snapshots>
-				<enabled>false</enabled>
+			<url>http://tomcat.apache.org/dev/dist/m2-repository</url>
+			<releases>
+				<enabled>true</enabled>
+				<updatePolicy>always</updatePolicy>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
 			</snapshots>
 		</repository>
 		<repository>
 			<id>apache-incubating</id>
-			<url>http://people.apache.org/repo/m2-incubating-repository</url>
-			<releases>
-				<enabled>true</enabled>
-				<updatePolicy>always</updatePolicy>
-			</releases>
-			<snapshots>
-				<enabled>false</enabled>
+			<url>http://people.apache.org/repo/m2-incubating-repository</url>
+			<releases>
+				<enabled>true</enabled>
+				<updatePolicy>always</updatePolicy>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
 			</snapshots>
 		</repository>
 		<repository>
 			<id>eclipse-repo</id>
 			<name>eclipse maven repository</name>
-			<url>http://repo1.maven.org/eclipse</url>
-			<releases>
-				<enabled>true</enabled>
-				<updatePolicy>always</updatePolicy>
-			</releases>
-			<snapshots>
-				<enabled>false</enabled>
+			<url>http://repo1.maven.org/eclipse</url>
+			<releases>
+				<enabled>true</enabled>
+				<updatePolicy>always</updatePolicy>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
 			</snapshots>
 		</repository>
 		<repository>

Modified: webservices/axis2/trunk/java/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java Mon May 28 04:47:38 2007
@@ -134,7 +134,8 @@
 		MessageContext response = mepClient
 				.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
 	  	SOAPBody body = response.getEnvelope().getBody();
-	  	OMElement element = body.getFirstElement().getFirstChildWithName(new QName("return"));
+	  	OMElement element = body.getFirstElement().getFirstChildWithName(
+	  	new QName("http://service.soapwithattachments.sample/xsd","return"));
 		System.out.println(element.getText());
 	}
 }

Modified: webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/build.xml?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/build.xml (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/build.xml Mon May 28 04:47:38 2007
@@ -51,7 +51,7 @@
 
      <!--Codegen wizard libraries -->
      <fileset id="codegen.libs" dir="${axis2.lib.dir}">
- 		<include name="geronimo-activation_1.1_spec-${activation.version}.jar" />
+ 		<include name="activation-${activation.version}.jar" />
  		<include name="annogen-${annogen.version}.jar" />
 		<include name="ant-${ant.version}.jar" />
 		<include name="axiom-api-${axiom.version}.jar" />
@@ -202,17 +202,21 @@
     		</classpath>	
 	</javac>
 	
-	<!-- create the Axis2CodegenWizard.jar -->
+	<!--Make available the resources for the plugin -->
         <copy todir="${codegen.plugin.output.dir}/class">
             <fileset dir="${codegen.output.dir}/${source.dir.name}" >
 		<include name="**/Codegen.properties" />
+		<exclude name="**/*.class" />
 	    </fileset>
         </copy>
       
+	<!-- create the Axis2CodegenWizard.jar -->
         <jar destfile="${codegen.plugin.output.dir}/Axis2CodegenWizard.jar" 
 	       basedir="${codegen.plugin.output.dir}/class"
            includes="org/apache/**"
           />
+	<delete dir="${codegen.plugin.output.dir}/src"></delete>
+	<delete dir="${codegen.plugin.output.dir}/class"></delete>
     </target>
 
     <!--Install the codegen plugin -->

Modified: webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/pom.xml?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/pom.xml Mon May 28 04:47:38 2007
@@ -20,7 +20,7 @@
 	<parent>
 		<groupId>org.apache.axis2</groupId>
 		<artifactId>axis2-parent</artifactId>
-		<version>SNAPSHOT</version>
+		<version>1.2-SNAPSHOT</version>
 		<relativePath>../../parent/pom.xml</relativePath>
 	</parent>
 	<artifactId>axis2.eclipse.codegen.plugin</artifactId>
@@ -137,8 +137,8 @@
 			</exclusions>
 		</dependency>
 		<dependency>
-			<groupId>org.apache.geronimo.specs</groupId>
-			<artifactId>geronimo-activation_1.1_spec</artifactId>
+			<groupId>javax.mail</groupId>
+			<artifactId>mail</artifactId>
 		</dependency>
 		<dependency>
 			<groupId>annogen</groupId>
@@ -298,7 +298,7 @@
 								<delete dir="./target/dist"/>
 								<mkdir dir="./target/dist"/>
 								<!--Filter tockens for the copy command to filter the versions of external dependencies -->
-								<filter token="version_number" value="SNAPSHOT"/>
+								<filter token="version_number" value="1.2-SNAPSHOT"/>
 								<filter token="activation.version" value="1.0-SNAPSHOT"/>
 								<filter token="annogen.version" value="0.1.0"/>
 								<filter token="ant.version" value="1.6.5"/>

Modified: webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java Mon May 28 04:47:38 2007
@@ -49,6 +49,8 @@
 import org.apache.axis2.wsdl.codegen.CodeGenerationEngine;
 import org.apache.ws.java2wsdl.Java2WSDLCodegenEngine;
 import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
@@ -293,7 +295,8 @@
                  //This will Create a jar file from the codegen results and add to the output 
                  //locations lib directory
                  if (outputPage.getCreateJarCheckBoxSelection()){
-                	 String tempCodegenLocation =  System.getProperty("user.dir")+File.separator+"codegen";
+                	 IWorkspace workspace = ResourcesPlugin.getWorkspace();
+                	 String tempCodegenLocation =  workspace.getRoot().getLocation().toString()+File.separator+"codegen";
                 	 String tempProjectSrcLocation = tempCodegenLocation+File.separator+"codegen_temp_src_"+
                 	 								 System.currentTimeMillis();
                 	 String tempProjectClassLocation = tempCodegenLocation+File.separator+"codegen_temp_class_"+

Modified: webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/build.xml?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/build.xml (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/build.xml Mon May 28 04:47:38 2007
@@ -184,17 +184,21 @@
     		</classpath>	
 	</javac>
 	
-	<!-- create the Axis2_Service_Archiver.jar -->
+	<!--Make available the resources for the plugin -->
           <copy todir="${service.plugin.output.dir}/class">
             <fileset dir="${service.output.dir}/${source.dir.name}" >
                 <include name="**/ServiceResources.properties" />
+		<exclude name="**/*.class" />
             </fileset>
           </copy>
 
-	  <jar destfile="${service.plugin.output.dir}/Axis2_Service_Archiver.jar" 
+          <!-- create the Axis2_Service_Archiver.jar -->
+	  <jar destfile="${service.plugin.output.dir}/Axis_Service_Archiver.jar" 
 	       basedir="${service.plugin.output.dir}/class"
            includes="org/apache/**"
           />
+	<delete dir="${service.plugin.output.dir}/src"></delete>
+	<delete dir="${service.plugin.output.dir}/class"></delete>
     </target>
 
     <!--Install the service plugin -->

Modified: webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/pom.xml?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/pom.xml Mon May 28 04:47:38 2007
@@ -20,7 +20,7 @@
 	<parent>
 		<groupId>org.apache.axis2</groupId>
 		<artifactId>axis2-parent</artifactId>
-		<version>SNAPSHOT</version>
+		<version>1.2-SNAPSHOT</version>
 		<relativePath>../../parent/pom.xml</relativePath>
 	</parent>
 	<artifactId>axis2.eclipse.service.plugin</artifactId>

Modified: webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/src/main/java/org/apache/axis2/tool/service/control/Controller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/src/main/java/org/apache/axis2/tool/service/control/Controller.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/src/main/java/org/apache/axis2/tool/service/control/Controller.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/src/main/java/org/apache/axis2/tool/service/control/Controller.java Mon May 28 04:47:38 2007
@@ -105,6 +105,7 @@
             												 page2Bean.getSelectedMethodNames());
             String serviceFileString = serviceXMLCreater.toString();
             	serviceFile = new File(currentUserDir + File.separator + fileName);
+            if (serviceFile.exists()){serviceFile.delete();}
             FileWriter serviceXMLFileWriter = new FileWriter(serviceFile, true);
             BufferedWriter writer = new BufferedWriter(serviceXMLFileWriter) ;
             writer.write(serviceFileString) ;
@@ -159,6 +160,7 @@
         try {
             //create a temporary directory and copy the files
             tempFileFolder = new File("Service-copy");
+            if (tempFileFolder.exists()){deleteDir(tempFileFolder);}
             tempFileFolder.mkdir();
             
             File metaInfFolder = new File(tempFileFolder, "META-INF");
@@ -167,14 +169,18 @@
             File libFolder = new File(tempFileFolder,"lib");
             libFolder.mkdir();
             
-            FileCopier copier = new FileCopier();
+            FileCopier classFilecopier = new FileCopier();
             //copy the classes
-            copier.copyFiles(classFileFolder, tempFileFolder,page1Bean.getFilter());
+            classFilecopier.copyFiles(classFileFolder, tempFileFolder,page1Bean.getFilter());
+            
             //copy the service.xml
-            copier.copyFiles(serviceFile, metaInfFolder,xmlFilter);
+            FileCopier serviceXMLcopier = new FileCopier();
+            serviceXMLcopier.copyFiles(serviceFile, metaInfFolder,xmlFilter);
+            
             //copy the libs
+            FileCopier libCopier = new FileCopier();
             for (int i=0;i < fileList.size();i++){
-               copier.copyFiles((File)fileList.get(i),libFolder,null); 
+            	libCopier.copyFiles((File)fileList.get(i),libFolder,null); 
             }
             
             if (isWSDLAvailable){

Modified: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java Mon May 28 04:47:38 2007
@@ -469,8 +469,8 @@
     public File getTemp() {
 
         String time = Calendar.getInstance().getTime().toString().replace(':', '-');
-        File temp = new File( getActiveProject().getProjectFilePath() + File.separator + "temp-" + time);
-        return temp;
+        return new File( getOutput() + File.separator + "temp-" + time);
+
     }
 
     public Module[] getModules() {

Modified: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/BottomPanel.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/BottomPanel.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/BottomPanel.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/BottomPanel.java Mon May 28 04:47:38 2007
@@ -89,35 +89,38 @@
             {
                 if (!outputDir.isDirectory())
                 {
-                JOptionPane.showMessageDialog(java2CodeFrame, "The Output Directory specified is invalid. Please provide a valid directory",
+                    JOptionPane.showMessageDialog(java2CodeFrame, "The Output Directory specified is invalid. Please provide a valid directory",
                             "Error!", JOptionPane.ERROR_MESSAGE);
                     java2CodeFrame.repaint();
                     return;
                 }
             }
 
-            String selected = java2CodeFrame.optionPane.buttonGroup.getSelection().getActionCommand();
+            String selected = java2CodeFrame.secondPanel.cmbCodeGenOption.getSelectedItem().toString() ;
+            if (selected.equalsIgnoreCase("default")) {
+                File temp = java2CodeFrame.secondPanel.codegenBean.getTemp();
+                java2CodeFrame.secondPanel.setDefaultCommonConfigurations();
+                java2CodeFrame.secondPanel.codegenBean.setOutput(temp.getAbsolutePath() );
 
-            if (selected.equalsIgnoreCase("radDefaultClient")) {
-                    File temp = java2CodeFrame.optionPane.setDefaultClientConfigurations();
-                    try {
-                        java2CodeFrame.generateDefaultClientCode(temp);
-                    } catch (Exception e1) {
-                        StringWriter writer = new StringWriter();
-                        JOptionPane.showMessageDialog(java2CodeFrame, "Code genaration failed!" + writer.toString(),
-                                "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
-                        java2CodeFrame.dispose();
-                        return;
-                    }
+                try {
 
-                    JOptionPane.showMessageDialog(java2CodeFrame, "Code generation successful!",
-                            "Axis2 code generation", JOptionPane.INFORMATION_MESSAGE);
+                    java2CodeFrame.generateDefaultClientCode( temp) ;
+                } catch (Exception e1) {
+                    StringWriter writer = new StringWriter();
+                    JOptionPane.showMessageDialog(java2CodeFrame, "Code genaration failed!" + writer.toString(),
+                            "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
                     java2CodeFrame.dispose();
                     return;
-
                 }
 
-           else if (selected.equalsIgnoreCase("radCustom")) {
+                JOptionPane.showMessageDialog(java2CodeFrame, "Code generation successful!",
+                        "Axis2 code generation", JOptionPane.INFORMATION_MESSAGE);
+                java2CodeFrame.dispose();
+                return;
+
+            }
+
+            else if (selected.equalsIgnoreCase("custom")) {
 
                 String output = java2CodeFrame.outputpane.buttonGroup.getSelection().getActionCommand();
 
@@ -130,44 +133,10 @@
                         java2CodeFrame.copyDirectory(new File(temp + File.separator + "src"), new File((String) java2CodeFrame.outputpane.cmbModuleSrc.getSelectedItem()));
                         File src = new File(temp + File.separator + "resources");
                         if (src.isDirectory())
-                        java2CodeFrame.copyDirectory(src, new File((String) java2CodeFrame.outputpane.cmbModuleSrc.getSelectedItem() + File.separator + ".." + File.separator + "resources"));
+                            java2CodeFrame.copyDirectory(src, new File((String) java2CodeFrame.outputpane.cmbModuleSrc.getSelectedItem() + File.separator + ".." + File.separator + "resources"));
 
                         java2CodeFrame.deleteDirectory(temp);
                     } catch (Exception e1) {
-                    StringWriter writer = new StringWriter();
-                    JOptionPane.showMessageDialog(java2CodeFrame, "Code genaration failed!" + writer.toString(),
-                            "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
-                    java2CodeFrame.dispose();
-                        return;
-                    }
-
-                }
-                else
-                {
-
-                try {
-
-                    java2CodeFrame.generatecode();
-
-                } catch (Exception e1) {
-                    StringWriter writer = new StringWriter();
-                    JOptionPane.showMessageDialog(java2CodeFrame, "Code genaration failed!" + writer.toString(),
-                            "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
-                    java2CodeFrame.dispose();
-                    return;
-                }
-                }
-            } else if (selected.equalsIgnoreCase("radDefaultServer")) {
-
-                File temp = java2CodeFrame.optionPane.setDefaultServerConfigurations();
-                String output = java2CodeFrame.outputpane.buttonGroup.getSelection().getActionCommand();
-
-                if (output.equalsIgnoreCase("radCurrentProject")) {
-
-                    try {
-
-                        java2CodeFrame.generateDefaultServerCode(temp, (String) java2CodeFrame.outputpane.cmbModuleSrc.getSelectedItem());
-                    } catch (Exception e1) {
                         StringWriter writer = new StringWriter();
                         JOptionPane.showMessageDialog(java2CodeFrame, "Code genaration failed!" + writer.toString(),
                                 "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
@@ -175,40 +144,13 @@
                         return;
                     }
 
-
-                } else {
-                    String path = java2CodeFrame.outputpane.txtoutput.getText();
-                    File outputPath = new File(path);
-                    if (outputPath.exists()) {
-                        try {
-                            java2CodeFrame.generateDefaultServerCodeCustomLocation(path);
-                        } catch (Exception e1) {
-                            StringWriter writer = new StringWriter();
-                            JOptionPane.showMessageDialog(java2CodeFrame, "Code genaration failed!" + writer.toString(),
-                                    "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
-                            java2CodeFrame.dispose();
-                            return;
-                        }
-
-                    } else {
-                        JOptionPane.showMessageDialog(java2CodeFrame, "Invalid file path!",
-                                "Error!!!", JOptionPane.INFORMATION_MESSAGE);
-                        return;
-                    }
-
-
                 }
-            } else if (selected.equalsIgnoreCase("radDefaultBoth")) {
-
-                File temp = java2CodeFrame.optionPane.setDefaultServerConfigurations();
-                String output = java2CodeFrame.outputpane.buttonGroup.getSelection().getActionCommand();
+                else
+                {
 
-                if (output.equalsIgnoreCase("radCurrentProject")) {
                     try {
 
-                        java2CodeFrame.generateDefaultServerCode(temp, (String) java2CodeFrame.outputpane.cmbModuleSrc.getSelectedItem());
-                        File temp2 = java2CodeFrame.optionPane.setDefaultClientConfigurations();
-                        java2CodeFrame.generateDefaultClientCode(temp2);
+                        java2CodeFrame.generatecode();
 
                     } catch (Exception e1) {
                         StringWriter writer = new StringWriter();
@@ -216,54 +158,28 @@
                                 "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
                         java2CodeFrame.dispose();
                         return;
-
                     }
+                }
 
-                } else {
-                    String path = java2CodeFrame.outputpane.txtoutput.getText();
-                    File outputPath = new File(path);
-                    if (outputPath.exists()) {
-                        try {
-                            java2CodeFrame.generateDefaultServerCodeCustomLocation(path);
-                            File temp2 = java2CodeFrame.optionPane.setDefaultClientConfigurations();
-                            java2CodeFrame.generateDefaultClientCode(temp2);
-                        } catch (Exception e1) {
-                            StringWriter writer = new StringWriter();
-                            JOptionPane.showMessageDialog(java2CodeFrame, "Code genaration failed!" + writer.toString(),
-                                    "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
-                            java2CodeFrame.dispose();
-                            return;
-                        }
-
-                    } else {
-                        JOptionPane.showMessageDialog(java2CodeFrame, "Invalid file path!",
-                                "Error!!!", JOptionPane.INFORMATION_MESSAGE);
-                        return;
-                    }
+            }
+            try {
 
+                java2CodeFrame.generatecode();
 
-                }
+            } catch (Exception e1) {
+                System.out.println(e1);
+                StringWriter writer = new StringWriter();
+                JOptionPane.showMessageDialog(java2CodeFrame, "Code genaration failed!" + writer.toString(),
+                        "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
+                java2CodeFrame.dispose();
+                return;
             }
-
             JOptionPane.showMessageDialog(java2CodeFrame, "Code generation successful!",
                     "Axis2 code generation", JOptionPane.INFORMATION_MESSAGE);
             java2CodeFrame.dispose();
             return;
 
         } else if (obj == btnNext) {
-
-                if (java2CodeFrame.optionPane.isVisible()) {
-
-                String selected = java2CodeFrame.optionPane.buttonGroup.getSelection().getActionCommand();
-
-
-                if (selected.equalsIgnoreCase("radDefaultServer") || selected.equalsIgnoreCase("radDefaultBoth")) {
-
-                    java2CodeFrame.increasePanelID();
-
-                }
-
-            }
 
             java2CodeFrame.setPane();
         }

Modified: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/Java2CodeFrame.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/Java2CodeFrame.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/Java2CodeFrame.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/Java2CodeFrame.java Mon May 28 04:47:38 2007
@@ -11,7 +11,6 @@
 import org.apache.axis2.tools.bean.CodegenBean;
 import org.apache.axis2.tools.bean.SrcCompiler;
 import org.apache.ideaplugin.bean.JarFileWriter;
-import org.apache.ideaplugin.frames.Axi2PluginPage;
 
 import javax.swing.*;
 import javax.wsdl.WSDLException;
@@ -48,13 +47,12 @@
     //    SecondPanel secondPanel;
     SecondFrame secondPanel;
     OutPutPane outputpane;
-    OptionPane optionPane;
     private int panleID = 0;
     private ClassLoader classLoader;
 
     // To keep the value of wsdl wizzard
     private CodegenBean codegenBean;
-
+    private int defaultCloseOperation;
     public Java2CodeFrame() {
         windowLayout customLayout = new windowLayout(1);
 
@@ -79,10 +77,6 @@
         BottomPanel.setEnable(false,false, false, true);
         getContentPane().add(lblBottom);
 
-        optionPane = new OptionPane();
-        optionPane.setVisible(false);
-        getContentPane().add(optionPane);
-
         secondPanel = new SecondFrame();
         secondPanel.setVisible(false);
         getContentPane().add(secondPanel);
@@ -96,6 +90,26 @@
         setBounds(200, 200, dim.width, dim.height);
     }
 
+    public void setDefaultCloseOperation(int operation) {
+        if (operation != DO_NOTHING_ON_CLOSE &&
+                operation != HIDE_ON_CLOSE &&
+                operation != DISPOSE_ON_CLOSE &&
+                operation != EXIT_ON_CLOSE) {
+            throw new IllegalArgumentException("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or EXIT_ON_CLOSE");
+        }
+        if (this.defaultCloseOperation != operation) {
+            if (operation == EXIT_ON_CLOSE) {
+                SecurityManager security = System.getSecurityManager();
+                if (security != null) {
+                    security.checkExit(0);
+                }
+            }
+            int oldValue = this.defaultCloseOperation;
+            this.defaultCloseOperation = operation;
+            firePropertyChange("defaultCloseOperation", oldValue, operation);
+        }
+    }
+
     public void setProject(Project project) {
         codegenBean.setProject(project);
     }
@@ -190,40 +204,39 @@
         try {
             codegenBean.generate();
             SrcCompiler compiler = new SrcCompiler();
-            compiler.compileSource(temp.getAbsolutePath());
+            compiler.compileSource(temp.getAbsolutePath()  );
             String wsdl = codegenBean.getWSDLFileName();
             final String name = wsdl.substring(wsdl.lastIndexOf(File.separatorChar) + 1, wsdl.lastIndexOf(".")) + "-stub";
-            final File lib = new File(codegenBean.getActiveProject().getProjectFilePath() + File.separator + "lib");
+            final File lib = new File(temp.getAbsolutePath() + File.separator + "lib");
             if (!lib.isDirectory()) {
                 lib.mkdir();
             }
             JarFileWriter jarFileWriter = new JarFileWriter();
-            jarFileWriter.writeJarFile(lib, name + ".jar", new File(temp + File.separator + "classes"));
+            jarFileWriter.writeJarFile(lib, name + ".jar", new File(temp.getAbsolutePath() + File.separator + "classes"));
             Project project = codegenBean.getActiveProject();
 
             final LibraryTable table = (LibraryTable) project.getComponent(LibraryTable.class);
 
-
-
-
             ApplicationManager.getApplication().runWriteAction(new
                     Runnable() {
                         public void run() {
-
                             String url = VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, lib.getAbsolutePath() + File.separator + name + ".jar") + JarFileSystem.JAR_SEPARATOR;
 
-
-
                             VirtualFile jarVirtualFile = VirtualFileManager.getInstance().findFileByUrl(url);
                             Library myLibrary = table.createLibrary(name);
                             Library.ModifiableModel libraryModel = myLibrary.getModifiableModel();
                             libraryModel.addRoot(jarVirtualFile, OrderRootType.CLASSES);
                             libraryModel.commit();
 
-
                         }
                     });
+
+            copyDirectory(new File(temp + File.separator + "src"), new File(codegenBean.getOutput()+File.separator + ".." + File.separator + "src") );
+            copyDirectory(new File(temp + File.separator + "lib"), new File(codegenBean.getOutput() + File.separator + ".." + File.separator + "lib"));
+            copyFiles(new File(temp + File.separator + "build.xml"), new File(codegenBean.getOutput() + File.separator + ".." + File.separator + "build.xml"));
+
         } catch (Exception e1) {
+
             throw e1;
         }
         finally {
@@ -246,18 +259,6 @@
                     panleID--;
                     break;
                 }
-                panel_3.setCaptions("  Options"
-                        , " Select from custom or default");
-                this.secondPanel.setVisible(false);
-                this.plMiddle.setVisible(false);
-                if (this.optionPane.codegenBean == null)
-                    this.optionPane.setCodeGenBean(codegenBean);
-                this.optionPane.setVisible(true);
-                this.outputpane.setVisible(false);
-                BottomPanel.setEnable(true,true, false, true);
-                break;
-            }
-            case 2: {
                 panel_3.setCaptions("  Custom Options"
                         , "  Set the options for the code generation");
 
@@ -266,26 +267,16 @@
                     this.secondPanel.setCodeGenBean(codegenBean);
                 this.secondPanel.setStatus();
                 this.plMiddle.setVisible(false);
-                this.optionPane.setVisible(false);
                 this.outputpane.setVisible(false);
                 BottomPanel.setEnable(true,true, false, true);
                 break;
             }
-            case 3: {
-                String result;
-                if (this.optionPane.radCustom.isSelected() && (result = validatePackageNames()) != null)
-                {
-                    JOptionPane.showMessageDialog(this, "The package name " + result + " is not a valid package name",
-                            "Error!!!", JOptionPane.INFORMATION_MESSAGE);
-                    panleID--;
-                    break;
-                }
+            case 2: {
 
                 panel_3.setCaptions("  Set the output location for the generated code"
                         , "  set the output project for the generated code");
                 this.secondPanel.setVisible(false);
                 this.plMiddle.setVisible(false);
-                this.optionPane.setVisible(false);
                 outputpane.loadCmbCurrentProject();
                 outputpane.loadcmbModuleSrcProject();
                 this.outputpane.setVisible(true);
@@ -322,51 +313,20 @@
                         , "  Welcome to the Axis2 code generation wizard. Select the WSDL file");
                 this.secondPanel.setVisible(false);
                 this.plMiddle.setVisible(true);
-
-                this.optionPane.setVisible(false);
                 this.outputpane.setVisible(false);
                 BottomPanel.setEnable(false,true, false, true);
                 break;
             }
             case 1: {
-
-                panel_3.setCaptions("  Options"
-                        , " Select from custom or default");
-                this.secondPanel.setVisible(false);
-                this.plMiddle.setVisible(false);
-                this.outputpane.setVisible(false);
-                this.optionPane.setVisible(true);
-                BottomPanel.setEnable(true,true, false, true);
-                break;
-            }
-            case 2: {
-                if (!this.optionPane.radCustom.isSelected())
-                {
-
-                    this.backButtonImpl();
-                    break;
-                }
                 panel_3.setCaptions("  Custom  Options"
                         , "  Set the options for the code generation");
 
                 this.secondPanel.setVisible(true);
                 this.plMiddle.setVisible(false);
-                this.optionPane.setVisible(false);
                 this.outputpane.setVisible(false);
                 BottomPanel.setEnable(true,true, false, true);
                 break;
             }
-            case 3: {
-                panel_3.setCaptions("  Set the output location for the generated code"
-                        , "  set the output project for the generated code");
-                this.secondPanel.setVisible(false);
-                this.plMiddle.setVisible(false);
-                this.optionPane.setVisible(false);
-
-                this.outputpane.setVisible(true);
-                BottomPanel.setEnable(true,false, true, true);
-                break;
-            }
         }
 
     }
@@ -377,13 +337,6 @@
 
     public void setMiddlerPanel(int panel) {
         this.panleID = panel;
-        if (panleID == 2) {
-            panel_3.setCaptions("  Options"
-                    , "  Set the options for the code generation");
-            this.secondPanel.setVisible(true);
-            this.plMiddle.setVisible(false);
-            BottomPanel.setEnable(true,true, true, true);
-        }
         this.pack();
         this.show();
     }
@@ -436,10 +389,6 @@
             c.setBounds(insets.left, insets.top + 80, 600, 480);
         }
         c = parent.getComponent(4);
-        if (c.isVisible()) {
-            c.setBounds(insets.left, insets.top + 80, 600, 480);
-        }
-        c = parent.getComponent(5);
         if (c.isVisible()) {
             c.setBounds(insets.left, insets.top + 80, 600, 480);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message