Results 1 to 5 of 5

Thread: Java Store Connector

  1. #1
    Join Date
    Jan 2009
    Posts
    66

    Java Store Connector

    Hello, I am learning java programming language and while learning it, I want to know the details about the java store connector. I am having reference book on java, but it is not having more details about it, so, if you are having details about the store connector then please reply me. And if you are having any details about the source or reference for this then provide that also.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Java Store Connector

    Hello, You can use the program below for java store connector. It will help you to get the details about it:
    Code:
    import com.devsphere.helpers.logging.*;
    import com.devsphere.logging.*;
    import com.devsphere.mapping.*;
    import java.io.*;
    import java.util.*;
    import java.lang.reflect.*;
    public abstract class StoreConnector 
    {
        protected Class beanClass;
        protected Object pro;
        protected Method mthod;
        protected boolean check;
        protected AbstractLogger abstractlogger;
        protected ApplicationErrorHandler apperrhandler;
        public void initialize(Class beanClass, Object pro, Method mthod,
            boolean check, AbstractLogger abstractlogger, ApplicationErrorHandler apperrhandler) {
            this.beanClass = beanClass;
            this.pro = pro;
            this.mthod = mthod;
            this.check = check;
            this.abstractlogger = abstractlogger;
            this.apperrhandler = apperrhandler;
        }
        public abstract boolean connect(String protc, String hst, String usr, String psw, String fName);
        public abstract void process();
        public abstract void disconnect();
        protected void processMessage(InputStream in) {
            Object beanObj = textToBean(in);
            if (beanObj != null)
                processBean(beanObj);
        }
        private Object textToBean(InputStream in) {
            Object beanObj = null;
            try {
                beanObj = beanClass.newInstance();
            } catch (Exception t) {
                apperrhandler.fatalError("[COULDNT_INSTANTIATE_BEAN_CLASS]", t,
                    beanClass.getName());
            }
            if (beanObj != null)
                try {
                    Hashtable errorTable
                        = TextUtils.textToBean(in, beanObj, abstractlogger);
                    if (errorTable != null)
                        apperrhandler.error("[MAPPING_ERRORS]", null,
                            errorTable.toString());
                } catch (IOException e) {
                    apperrhandler.fatalError("[COULDNT_READ_BEAN_DATA]", e);
                }
    
            return beanObj;
        }
        private void processBean(Object beanObj) {
            try {
                mthod.invoke(pro, new Object[] { beanObj } );
            } catch (InvocationTargetException e) {
                Throwable throwable = e.getTargetException();
                if (throwable instanceof Exception)
                    apperrhandler.error("[PROCESSING_ERROR]", (Exception) throwable);
                else if (throwable instanceof Error)
                    throw (Error) throwable;
            } catch (Exception throwable) {
                apperrhandler.fatalError("[COULDNT_INVOKE_PROC_METHOD]", t,
                    mthod.getName());
            }
        }
    }

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Java Store Connector

    The Java 2 Platform, Enterprise Edition provides containers for client applications, web components and Enterprise JavaBeans components. These containers provide deployment and runtime support for application components. They also provide a federated view of the services provided by the underlying application server for the application components. Containers run on existing systems: web servers for the web containers, application servers, transaction processing monitors, and database systems for EJB containers. This enables enterprises to leverage both the advantages of their existing systems and those with J2EE technology. Enterprises can write new applications using J2EE capabilities and can also encapsulate parts of existing applications with EJB or JSP technologies.

  4. #4
    Join Date
    May 2008
    Posts
    2,012

    Re: Java Store Connector

    You can use the IMAP store connector for getting the details of the store connector:
    Code:
    import javax.mail.*;
    import javax.mail.event.*;
    import java.io.*;
    public class IMAPSConnect extends MailStoreConnector {
        protected Message[] getMessages() {
            Message message[] = null;
            try {
                message = folder.getMessages();
                FetchProfile fetchprofile = new FetchProfile();
                fetchprofile.add(FetchProfile.Item.FLAGS);
                folder.fetch(message, fetchprofile);
            } catch (MessagingException me) {
                errorHandler.fatalError("[COULDNT_GET_MESSAGES]", me);
            }
            return message;
        }
        protected boolean wasProcessed(Message message) {
            try {
                return message.isSet(Flags.Flag.SEEN);
            } catch (MessagingException me) {
                errorHandler.fatalError("[COULDNT_GET_SEEN_FLAG]", me);
            }
            return true;
        }
    
    }

  5. #5
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Java Store Connector

    Java provide the StoreConnector class and The StoreConnector class provide you the method having name as initialize() method. It is used to declare three abstract methods as below:
    • connect()
    • process()
    • disconnect()

    And it also implements one helping method as
    • processMessage()

Similar Threads

  1. How to store mail files using apple mail store
    By Janya in forum Technology & Internet
    Replies: 3
    Last Post: 06-09-2011, 10:23 AM
  2. Unable to Connect iTunes Store/App Store from the Apple iPad
    By DougWison in forum Portable Devices
    Replies: 4
    Last Post: 22-08-2011, 09:56 AM
  3. java- store a web page in memory
    By arvindikchari in forum Software Development
    Replies: 1
    Last Post: 15-06-2011, 12:19 AM
  4. Replies: 5
    Last Post: 01-03-2011, 10:14 AM
  5. How to Add a Certificate to a Key Store with the help of java?
    By Jagdish Gada in forum Software Development
    Replies: 4
    Last Post: 18-02-2010, 08:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,913,465.38013 seconds with 16 queries