Examples of InitialContext


Examples of javax.naming.InitialContext

      //return new InitialContext();  /*** context initialized by jndi.properties file
        java.util.Properties p = new java.util.Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
        p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
        p.put(Context.PROVIDER_URL, "localhost");
        return new InitialContext(p);
   }
View Full Code Here

Examples of javax.naming.InitialContext

   */
  private static final String getHostName(String dataSource)
  {
    String hostName = "";
    try {
      InitialContext ic = new InitialContext();
      ServerSettingsHome serverSettingsHome = (ServerSettingsHome)CVUtility.getHomeObject("com.centraview.administration.serversettings.ServerSettingsHome", "ServerSettings");
      ServerSettings serverSettingsRemote = (ServerSettings)serverSettingsHome.create();
      serverSettingsRemote.setDataSource(dataSource);
      ServerSettingsVOX serverSettings = serverSettingsRemote.getServerSettings();
      hostName = serverSettings.getHostName();
View Full Code Here

Examples of javax.naming.InitialContext

        boolean buttonOperationFlag = false;
        //Setting the DataSource
        String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(this.pageContext.getServletContext())).getDataSource();
        try
        {
          InitialContext ic = CVUtility.getInitialContext();
        AuthorizationHome authorizationHome = (AuthorizationHome)CVUtility.getHomeObject("com.centraview.administration.authorization.AuthorizationHome", "Authorization");
          Authorization authorization = authorizationHome.create();
        authorization.setDataSource(dataSource);
        buttonOperationFlag = authorization.canPerformRecordOperation(individualID, this.modulename, this.recordID, this.buttonoperationtype);
        }// end of try block
View Full Code Here

Examples of javax.naming.InitialContext

        // we could be calling from JBoss and for somereason it isn't setup.
        // So we are going to try and default.
        Properties props = new Properties();
        props.setProperty(NAMING_FACTORY_KEY, "org.jnp.interfaces.NamingContextFactory");
        props.setProperty(NAMING_PROVIDER_KEY, "jnp://localhost:1099");
        initialContext = new InitialContext(props);
      }
      return initialContext;
    } catch (Exception e) {
      logger.error("[getInitialContext] Exception thrown.", e);
    }
View Full Code Here

Examples of javax.naming.InitialContext

   */
  public static void addHistoryRecord(HashMap historyInfo, String dataSource)
  {
    try {

      InitialContext ic = getInitialContext();

      // Call Local EJB to add the record in DB
      HistoryLocalHome historyLocal = (HistoryLocalHome) ic.lookup("local/History");
      HistoryLocal history = historyLocal.create();
      history.setDataSource(dataSource);
      history.addHistoryRecord(historyInfo);

    } catch (Exception e) {
View Full Code Here

Examples of javax.naming.InitialContext

    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(((HttpServlet)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLET)).getServletContext())).getDataSource();
    int authenticationString = AUTHENTICATION_FAILED_STATUS;
    HashMap hm = null;
    getPATH();
    try {
      InitialContext ic = CVUtility.getInitialContext();
      LoginHome lh = (LoginHome) ic.lookup("Login");
      Login remote = (Login) lh.create();
      remote.setDataSource(dataSource);
      hm = (HashMap) remote.authenticateUser(userName, passwd);
      //checking hashmap
      if (hm != null && hm.get("userid")!= null && hm.get("individualid")!= null && hm.get("lastName")!= null && hm.get("firstName")!= null ) {
View Full Code Here

Examples of javax.naming.InitialContext

  private ArrayList SynchronizeMod(int individualID, Date LastSyncDate, String moduleName, ArrayList VO, String isNewFlag)
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(((HttpServlet)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLET)).getServletContext())).getDataSource();
    ArrayList arrlfromCV = null;
    try {
      InitialContext it = CVUtility.getInitialContext();
      QBSyncHome qbsh = (QBSyncHome) it.lookup("QBSync");
      QBSync remote = (QBSync) qbsh.create();
      remote.setDataSource(dataSource);
      arrlfromCV = (ArrayList) remote.beginSynchronisation(individualID, LastSyncDate, moduleName, VO, isNewFlag);
    }
    catch (Exception e) {
View Full Code Here

Examples of javax.naming.InitialContext

  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(((HttpServlet)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLET)).getServletContext())).getDataSource();
    boolean resultFlag = false;
    try
    {
      InitialContext it = CVUtility.getInitialContext();
      QBSyncHome qbsh = (QBSyncHome) it.lookup("QBSync");
      QBSync remote = (QBSync) qbsh.create();
      remote.setDataSource(dataSource);
      resultFlag = (boolean)remote.updateExternalIDs(hm, moduleName);
    }
    catch (Exception e)
View Full Code Here

Examples of javax.naming.InitialContext

  private void deleteObjects(String ModuleName, ArrayList VO, int individualID)
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(((HttpServlet)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLET)).getServletContext())).getDataSource();
    try
    {
      InitialContext it = CVUtility.getInitialContext();
      QBSyncHome qbsh = (QBSyncHome) it.lookup("QBSync");
      QBSync remote = (QBSync) qbsh.create();
      remote.setDataSource(dataSource);
      remote.deleteObjects(ModuleName, VO, individualID);
    }
    catch (Exception e)
View Full Code Here

Examples of javax.naming.InitialContext

    String xmlVo = "";
    if (checkForSession() == true) {
      try
      {
        //EJB call
        InitialContext it = CVUtility.getInitialContext();
        QBSyncHome qbsh = (QBSyncHome) it.lookup("QBSync");
        QBSync remote = (QBSync) qbsh.create();
        remote.setDataSource(dataSource);
        //convertion module calls here
        QBXMLConverter converter = new QBXMLConverter();
        converter.setDataSource(dataSource);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.