Package javax.naming

Examples of javax.naming.InitialContext


   */
  public static void deleteHistoryRecord(int recordID, int recordTypeID, int operation, String ds)
  {
    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(ds);
      history.deleteHistoryRecord(operation, recordTypeID, recordID);
    } catch (Exception e) {
      logger.error("[deleteHistoryRecord]: Exception", e);
View Full Code Here


  public static boolean isModuleVisible(String moduleName, int individualId, String dataSource)
  {
    boolean retVal = false;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome home = (AuthorizationLocalHome) ic.lookup("local/Authorization");
      AuthorizationLocal local = home.create();
      local.setDataSource(dataSource);
      retVal = local.isModuleVisible(moduleName, individualId);
    } catch (Exception e) {
      logger.error("[isModuleVisible]: Exception", e);
View Full Code Here

   */
  public static Object replaceVO(Object objDBVO, Object objUIVO, String moduleName, int individualId, String dataSource)
  {
    HashMap hm = new HashMap();
    try {
      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome home = (AuthorizationLocalHome) ic.lookup("local/Authorization");
      AuthorizationLocal local = home.create();
      local.setDataSource(dataSource);

      hm = local.getNoneRightFieldMethod(moduleName, individualId);
      if (hm != null) {
View Full Code Here

  public static ModuleFieldRightMatrix getUserModuleRight(String moduleName, int individualId, boolean byListCol, String dataSource)
  {
    ModuleFieldRightMatrix retVal = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome home = (AuthorizationLocalHome) ic.lookup("local/Authorization");
      AuthorizationLocal local = home.create();
      local.setDataSource(dataSource);
      retVal = local.getUserSecurityProfileMatrix(moduleName, individualId, byListCol);
    } catch (Exception e) {
      logger.error("[getUserModuleRight]: Exception", e);
View Full Code Here

  public static boolean canPerformRecordOperation(int indId, String moduleName, int recordId, int privilegeLevel, String dataSource)
  {
    boolean retVal = false;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome home = (AuthorizationLocalHome) ic.lookup("local/Authorization");
      AuthorizationLocal local = home.create();
      local.setDataSource(dataSource);
      retVal = local.canPerformRecordOperation(indId, moduleName, recordId, privilegeLevel);
    } catch (Exception e) {
      logger.error("[canPerformRecordOperation]: Exception", e);
View Full Code Here

    if (this.recordID != 0 && this.modulename != null && this.buttonoperationtype != 0){
      boolean buttonOperationFlag = false;
      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

  private IndividualVO getIndividualVO(int individualID)
  {
    IndividualVO individualVO = new IndividualVO();
    try
    {
      InitialContext ic = new InitialContext();
      IndividualLocalHome home = (IndividualLocalHome)
        ic.lookup("local/Individual");
      IndividualLocal remote =  home.findByPrimaryKey(
        new IndividualPK(individualID, this.dataSource));
      individualVO = remote.getIndividualVOWithBasicReferences();
    } //end of try block
    catch (Exception e)
View Full Code Here

  }

  private UserTransaction getUserTransaction()
      throws NamingException
  {
    InitialContext ctx = new InitialContext();
    UserTransaction tx = (UserTransaction)ctx.lookup("UserTransaction");
    return tx;
  }
View Full Code Here

  public ProcessEnginePluginImpl()
  {
    try
    {
      InitialContext ctx = new InitialContext();
      engine = (BPELEngine)ctx.lookup("bpel/Engine");
    }
    catch (NamingException e)
    {
      throw new RuntimeException("Failed to initialize BPEL engine");
    }
View Full Code Here

          serviceName, portName, soapAdapter));
  }

  private BPELEngine getEngine() {
    try {
      InitialContext ctx = new InitialContext();
      return (BPELEngine)ctx.lookup("bpel/Engine");
    } catch (NamingException e) {
      throw new RuntimeException("Failed to initialize BPEL engine");
    }
  }
View Full Code Here

TOP

Related Classes of javax.naming.InitialContext

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.