Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.MailConfiguration


     * @return Session
     *         Mail session to use for this action
     */
    private void invokeSession(Notification event) throws NamingException {       
       
        MailConfiguration mailConfiguration = null;
    
        if (mailResource != null) {
            InitialContext ic = new InitialContext();
         
            /*
             *Currently an internal object is returned by ic lookup.
             *This jndi lookup needs to be fixed to return Session type.
             */                   
            //mailSession = (Session) ic.lookup(mailResource);
            mailConfiguration = (MailConfiguration) ic.lookup(mailResource);
            mailSession = Session.getInstance(mailConfiguration.getMailProperties(),
                                              null);           
        } else {
            mailSession = Session.getDefaultInstance(new Properties());
        }   
    }
View Full Code Here


       
    /**
     * notification of the end of XML parsing for this node
     */
    public void postParsing() {
        getParentNode().addDescriptor(new MailConfiguration(name, mail_from, mail_host));                   
    }
View Full Code Here

        Reference ref = (Reference) obj;
        if(_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE,"MailNamingObjectFactory: " + ref +
                " Name:" + name);
        }
        MailConfiguration config = (MailConfiguration) ref.get(0).getContent();

        // Note: javax.mail.Session is not serializable,
        // but we need to get a new instance on every lookup.
        Properties props = config.getMailProperties();
        javax.mail.Session s = javax.mail.Session.getInstance(props, new MailSessionAuthenticator(props));
        if("smtps".equals(props.getProperty("mail.transport.protocol"))) {
            s.setProtocolForAddress("rfc822", "smtps");
        }
        s.setDebugOut(new PrintStream(new MailLogOutputStream()));
View Full Code Here

       
    /**
     * notification of the end of XML parsing for this node
     */
    public void postParsing() {
        getParentNode().addDescriptor(new MailConfiguration(name, mail_from, mail_host));                   
    }
View Full Code Here

       
    /**
     * notification of the end of XML parsing for this node
     */
    public void postParsing() {
        getParentNode().addDescriptor(new MailConfiguration(name, mail_from, mail_host));                   
    }
View Full Code Here

     */
    public void installMailResource(org.glassfish.resources.javamail.beans.MailResource mailResource, ResourceInfo resourceInfo) {

        try {

            MailConfiguration config = new MailConfiguration(mailResource);

            javax.naming.Reference ref = new javax.naming.Reference(javax.mail.Session.class.getName(),
                    MailNamingObjectFactory.class.getName(), null);
            SerializableObjectRefAddr serializableRefAddr = new SerializableObjectRefAddr("jndiName", config);
            ref.add(serializableRefAddr);
View Full Code Here

        Reference ref = (Reference) obj;
        if(_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE,"MailNamingObjectFactory: " + ref +
                " Name:" + name);
        }
        MailConfiguration config = (MailConfiguration) ref.get(0).getContent();

        // Note: javax.mail.Session is not serializable,
        // but we need to get a new instance on every lookup.
        Properties props = config.getMailProperties();
        javax.mail.Session s = javax.mail.Session.getInstance(props, new MailSessionAuthenticator(props));
        if("smtps".equals(props.getProperty("mail.transport.protocol"))) {
            s.setProtocolForAddress("rfc822", "smtps");
        }
        s.setDebugOut(new PrintStream(new MailLogOutputStream()));
View Full Code Here

     */
    public void installMailResource(com.sun.enterprise.resource.beans.MailResource mailResource, ResourceInfo resourceInfo) {

        try {

            MailConfiguration config = new MailConfiguration(mailResource);

            javax.naming.Reference ref = new javax.naming.Reference(javax.mail.Session.class.getName(),
                    MailNamingObjectFactory.class.getName(),null);
            SerializableObjectRefAddr serializableRefAddr = new SerializableObjectRefAddr("jndiName", config);
            ref.add(serializableRefAddr);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.MailConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.