Example usage for java.lang InternalError InternalError

List of usage examples for java.lang InternalError InternalError

Introduction

In this page you can find the example usage for java.lang InternalError InternalError.

Prototype

public InternalError(Throwable cause) 

Source Link

Document

Constructs an InternalError with the specified cause and a detail message of (cause==null ?

Usage

From source file:com.clustercontrol.calendar.etc.action.CalendarPatternAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?/*from  w  w w. j a  v a  2s  .c  o  m*/
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(CalendarPatternView.ID);
        IViewPart viewPart = page.findView(CalendarPatternView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");
        CalendarPatternView view = (CalendarPatternView) viewPart.getAdapter(CalendarPatternView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:com.clustercontrol.jobmanagement.etc.action.JobDetailAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?//ww  w  .j  a v a 2s .  c om
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(JobDetailView.ID);
        IViewPart viewPart = page.findView(JobDetailView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");
        JobDetailView view = (JobDetailView) viewPart.getAdapter(JobDetailView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:com.clustercontrol.infra.etc.action.InfraModuleAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?//from w ww .  ja va  2s.c  o m
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(InfraModuleView.ID);
        IViewPart viewPart = page.findView(InfraModuleView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");
        InfraModuleView view = (InfraModuleView) viewPart.getAdapter(InfraModuleView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:com.clustercontrol.jobmanagement.etc.action.JobKickListAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?/* w  w w.  j  a v a  2 s  .  c o  m*/
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(JobKickListView.ID);
        IViewPart viewPart = page.findView(JobKickListView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");
        JobKickListView view = (JobKickListView) viewPart.getAdapter(JobKickListView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:com.clustercontrol.jobmanagement.etc.action.JobPlanAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?/*from  w w  w  .  j  a va2 s  . c  o m*/
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(JobPlanListView.ID);
        IViewPart viewPart = page.findView(JobPlanListView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");

        JobPlanListView view = (JobPlanListView) viewPart.getAdapter(JobPlanListView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:com.clustercontrol.jobmanagement.etc.action.JobNodeDetailAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?//w  w  w  .  j a  v  a2s . co m
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(JobNodeDetailView.ID);
        IViewPart viewPart = page.findView(JobNodeDetailView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");
        JobNodeDetailView view = (JobNodeDetailView) viewPart.getAdapter(JobNodeDetailView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:com.clustercontrol.jobmanagement.etc.action.ForwardFileListAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?//from  w  ww .  ja  v  a2 s . c  o  m
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(ForwardFileView.ID);
        IViewPart viewPart = page.findView(ForwardFileView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");
        ForwardFileView view = (ForwardFileView) viewPart.getAdapter(ForwardFileView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:com.clustercontrol.accesscontrol.etc.action.RoleSettingTreeAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?//from   w  ww .j  a v  a2  s . c  om
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(RoleSettingTreeView.ID);
        IViewPart viewPart = page.findView(RoleSettingTreeView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");
        RoleSettingTreeView view = (RoleSettingTreeView) viewPart.getAdapter(RoleSettingTreeView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:com.clustercontrol.infra.etc.action.InfraManagementAction.java

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //?/*from  w  w  w. j a  v a 2 s . co  m*/
    IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

    //?
    try {
        page.showView(InfraManagementView.ID);
        IViewPart viewPart = page.findView(InfraManagementView.ID);
        if (viewPart == null)
            throw new InternalError("viewPart is null.");
        InfraManagementView view = (InfraManagementView) viewPart.getAdapter(InfraManagementView.class);
        if (view == null) {
            m_log.info("execute: view is null");
            return null;
        }
        view.setFocus();
    } catch (PartInitException e) {
    }
    return null;
}

From source file:edu.ku.brc.af.core.expresssearch.QueryAdjusterForDomain.java

/**
 * Returns the instance to the singleton
 * @return  the instance to the singleton
 */// ww w  .j av a  2 s.co m
public static QueryAdjusterForDomain getInstance() {
    if (instance != null) {
        return instance;
    }

    // else
    String factoryNameStr = AccessController.doPrivileged(new java.security.PrivilegedAction<String>() {
        public String run() {
            return System.getProperty(factoryName);
        }
    });

    if (isNotEmpty(factoryNameStr)) {
        try {
            return instance = (QueryAdjusterForDomain) Class.forName(factoryNameStr).newInstance();

        } catch (Exception e) {
            edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
            edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(QueryAdjusterForDomain.class, e);
            InternalError error = new InternalError(
                    "Can't instantiate ExpressSearchSQLAdjuster factory " + factoryNameStr); //$NON-NLS-1$
            error.initCause(e);
            throw error;
        }
    }
    // if not factory than pass an instance of this in
    // and this does nothing to the SQL.
    return instance = new QueryAdjusterForDomain();
}