Package javax.naming

Examples of javax.naming.InitialContext


  {
    CVDal cvdl = new CVDal(dataSource);

    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      ActivityHelperLocalHome home = (ActivityHelperLocalHome)ic.lookup("local/ActivityHelper");
      ActivityHelperLocal remote = (ActivityHelperLocal) home.create();
      remote.setDataSource(dataSource);
      remote.deleteActivity(taskId,individualID);

      cvdl.setSql("projecttask.selecttaskaction");
View Full Code Here


  {
    try{
      MailMessageVO mailMessageVO = new MailMessageVO();
      ArrayList toList = new ArrayList();

      InitialContext ic = CVUtility.getInitialContext();
      ContactHelperLocalHome contactHome = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
      ContactHelperLocal contactRemote = (ContactHelperLocal)contactHome.create();
      contactRemote.setDataSource(dataSource);
      toList = contactRemote.getEmailContactForIndividuals(individualIDs);
      String fromAddress = contactRemote.getPrimaryEmailAddress(individualID,2);

      if (fromAddress != null && !fromAddress.equals("") && toList != null && toList.size() != 0)
      {
        EmailSettingsLocalHome emailSettingsHome = (EmailSettingsLocalHome)ic.lookup("local/EmailSettings");
        EmailSettingsLocal emailSettingsRemote = (EmailSettingsLocal)emailSettingsHome.create();
        emailSettingsRemote.setDataSource(dataSource);

        // Its a predefined Template for the replying message for Task Completion
        EmailTemplateForm taskTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_TASK);
View Full Code Here

   * Deletes project
   */
  public void deleteProject(int indvID, int projectID) throws AuthorizationFailedException
  {
    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectLocalHome home = (ProjectLocalHome)ic.lookup("local/Project");
      ProjectLocal remote = (ProjectLocal)home.create();
      remote.setDataSource(this.dataSource);
      remote.deleteProject(indvID, projectID);
    } catch (CreateException ce) {
      throw new EJBException(ce);
View Full Code Here

  public int addProject(int userId, ProjectVO pvo)
  {
    int projectId = 0;

    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectLocalHome home = (ProjectLocalHome)ic.lookup("local/Project");
      ProjectLocal remote = (ProjectLocal)home.create();
      remote.setDataSource(this.dataSource);

      projectId = remote.addProject(userId, pvo);
    } catch (Exception e) {
View Full Code Here

  }

  public void updateProject(int userId, ProjectVO pvo)
  {
    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectLocalHome home = (ProjectLocalHome)ic.lookup("local/Project");
      ProjectLocal remote = (ProjectLocal)home.create();
      remote.setDataSource(this.dataSource);

      remote.updateProject(userId, pvo);
    } catch (Exception e) {
View Full Code Here

  public ProjectVO getProject(int projectId, int userId)
  {
    ProjectVO projectVO = null;

    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectLocalHome home = (ProjectLocalHome)ic.lookup("local/Project");
      ProjectLocal remote = (ProjectLocal)home.create();
      remote.setDataSource(this.dataSource);

      projectVO = remote.getProject(projectId, userId);
    } catch (Exception e) {
View Full Code Here

  public ProjectList getProjectList(int userID, HashMap info)
  {
    ProjectList projectList = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectListsLocalHome home = (ProjectListsLocalHome)ic.lookup("local/ProjectLists");
      ProjectListsLocal remote = (ProjectListsLocal)home.create();
      remote.setDataSource(this.dataSource);
      projectList = (ProjectList)remote.getProjectList(userID, info);
    } catch (Exception e) {
      System.out.println("[Exception][ProjectFacadeEJB.getProjectList] Exception Thrown: " + e);
View Full Code Here

   */
  public int addProjectTask(int userId, TaskVO tvo)
  {
    int id = 0;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      TaskLocalHome home = (TaskLocalHome)ic.lookup("local/Task");
      TaskLocal remote = (TaskLocal)home.create();
      remote.setDataSource(this.dataSource);
      id = remote.addTask(userId, tvo);
    } catch (Exception e) {
      System.out.println("[Exception][ProjectFacadeEJB.addProjectTask] Exception Thrown: " + e);
View Full Code Here

      throw new AuthorizationFailedException(
          "<error> You don't have privilege to update some Records. </error>");
    }

    try {
      InitialContext ic = CVUtility.getInitialContext();
      TaskLocalHome home = (TaskLocalHome)ic.lookup("local/Task");
      TaskLocal remote = (TaskLocal)home.create();
      remote.setDataSource(this.dataSource);
      remote.updateTask(userId, tvo);
    } catch (Exception e) {
      System.out.println("[Exception][ProjectFacadeEJB.updateProjectTask] Exception Thrown: " + e);
View Full Code Here

      throw new AuthorizationFailedException(
          "<error> You don't have privilege to Delete some Records. </error>");
    }

    try {
      InitialContext ic = CVUtility.getInitialContext();
      TaskLocalHome home = (TaskLocalHome)ic.lookup("local/Task");
      TaskLocal remote = (TaskLocal)home.create();
      remote.setDataSource(this.dataSource);

      remote.deleteTask(taskID, individualID);
    } catch (CreateException ce) {
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.