Example usage for java.lang InstantiationException getStackTrace

List of usage examples for java.lang InstantiationException getStackTrace

Introduction

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

Prototype

public StackTraceElement[] getStackTrace() 

Source Link

Document

Provides programmatic access to the stack trace information printed by #printStackTrace() .

Usage

From source file:org.kuali.kpme.tklm.leave.accrual.bucket.KPMEAccrualCategoryBucket.java

public void addLeaveBlock(LeaveBlock leaveBlock) throws KPMEBalanceException {
    AccrualCategory accrualCategory = leaveBlock.getAccrualCategoryObj();
    List<LeaveBalance> balancesForAccrualCategory = leaveBalances.get(accrualCategory.getLmAccrualCategoryId());
    if (balancesForAccrualCategory == null) {
        try {/*from w  w w .j  a v  a2s  .co  m*/
            initialize(accrualCategory);
        } catch (InstantiationException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (IllegalAccessException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (IllegalArgumentException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (InvocationTargetException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        }
    }
    if (!(StringUtils.equals(leaveBlock.getRequestStatus(), HrConstants.REQUEST_STATUS.DEFERRED)
            || StringUtils.equals(leaveBlock.getRequestStatus(), HrConstants.REQUEST_STATUS.DISAPPROVED))) {
        for (LeaveBalance leaveBalance : balancesForAccrualCategory) {
            leaveBalance.add(leaveBlock);
        }
    }

}

From source file:org.kuali.kpme.tklm.leave.accrual.bucket.KPMEAccrualCategoryBucket.java

public void removeLeaveBlock(LeaveBlock leaveBlock) throws KPMEBalanceException {
    AccrualCategory accrualCategory = leaveBlock.getAccrualCategoryObj();
    List<LeaveBalance> balancesForAccrualCategory = leaveBalances.get(accrualCategory.getLmAccrualCategoryId());
    if (balancesForAccrualCategory == null) {
        try {/* w  w w  . j  ava  2  s  .co m*/
            initialize(accrualCategory);
        } catch (InstantiationException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (IllegalAccessException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (IllegalArgumentException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (InvocationTargetException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        }
    }

    if (!(StringUtils.equals(leaveBlock.getRequestStatus(), HrConstants.REQUEST_STATUS.DEFERRED)
            || StringUtils.equals(leaveBlock.getRequestStatus(), HrConstants.REQUEST_STATUS.DISAPPROVED))) {
        //leaveBalance.add is gaurded by the same conditional. These should not exist in any leave balance,
        //except perhaps a "DEFERRED" or "DISAPPROVED" leave balance.
        for (LeaveBalance leaveBalance : balancesForAccrualCategory) {
            leaveBalance.remove(leaveBlock);
        }
    }
}

From source file:org.kuali.kpme.tklm.leave.accrual.bucket.KPMEAccrualCategoryBucket.java

public void editLeaveBlock(LeaveBlock leaveBlock) throws KPMEBalanceException {
    AccrualCategory accrualCategory = leaveBlock.getAccrualCategoryObj();
    List<LeaveBalance> balancesForAccrualCategory = leaveBalances.get(accrualCategory.getLmAccrualCategoryId());
    if (balancesForAccrualCategory == null) {
        try {//from ww  w  .ja va 2s .com
            initialize(accrualCategory);
        } catch (InstantiationException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (IllegalAccessException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (IllegalArgumentException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        } catch (InvocationTargetException e) {
            KPMEBalanceException be = new KPMEBalanceException();
            be.setStackTrace(e.getStackTrace());
            throw be;
        }
    }

    for (LeaveBalance leaveBalance : balancesForAccrualCategory) {
        leaveBalance.adjust(leaveBlock);
    }
}

From source file:org.kuali.rice.kcb.service.impl.MessageDelivererRegistryServiceImpl.java

/**
 * Implements by constructing instances of each registered class and adding to an ArrayList that
 * gets passed back to the calling method.
 * @see MessageDelivererRegistryService#getAllDelivererTypes()
 *//*www.ja va  2  s  . c o  m*/
public Collection<MessageDeliverer> getAllDeliverers() {
    ArrayList<MessageDeliverer> delivererTypes = new ArrayList<MessageDeliverer>();

    Set<Entry<String, Class<? extends MessageDeliverer>>> registeredTypes = messageDelivererTypes.entrySet();

    // iterate over each type and add an instance of each to the returning ArrayList
    for (Entry<String, Class<? extends MessageDeliverer>> entry : registeredTypes) {
        try {
            delivererTypes.add(entry.getValue().newInstance());
        } catch (InstantiationException e) {
            LOG.error(e.getStackTrace());
        } catch (IllegalAccessException e) {
            LOG.error(e.getStackTrace());
        }
    }

    return delivererTypes;
}

From source file:org.kuali.rice.kcb.service.impl.MessageDelivererRegistryServiceImpl.java

/**
 * Implements by doing a key lookup in the hashmap that acts as the deliverer plugin registry.  The deliverer name is the key in the hashmap for 
 * all registered deliverers.//from  w  w w  .  j  a  v  a  2 s .  c  om
 * @see MessageDelivererRegistryService#getDelivererByName(String)
 */
public MessageDeliverer getDelivererByName(String messageDelivererName) {
    if (StringUtils.isBlank(messageDelivererName)) {
        throw new RiceIllegalArgumentException("messageDelivererName is null or blank");
    }

    Class<? extends MessageDeliverer> clazz = messageDelivererTypes.get(messageDelivererName.toLowerCase());

    if (clazz == null) {
        LOG.error("The message deliverer type ('" + messageDelivererName + "') "
                + " was not found in the message deliverer registry.  This deliverer "
                + "plugin is not in the system.");
        return null;
    }

    MessageDeliverer messageDeliverer = null;
    try {
        messageDeliverer = clazz.newInstance();
    } catch (InstantiationException e) {
        LOG.error(e.getStackTrace());
    } catch (IllegalAccessException e) {
        LOG.error(e.getStackTrace());
    }

    return messageDeliverer;
}

From source file:pt.webdetails.cdf.dd.render.Renderer.java

protected Object getRender(JXPathContext context) throws Exception {
    String renderType = null;//from ww  w  . j a v  a  2s . c  o m
    try {
        renderType = (String) context.getValue("type");
        if (!renderType.equals("Label")) {
            Class<?> rendererClass = Class.forName(getRenderClassName(renderType));

            Constructor<?> constructor = rendererClass.getConstructor(rendererConstructorArgs);
            return constructor.newInstance(new Object[] { context });
        }
    } catch (InstantiationException e) {
        logger.error(e.getStackTrace());
    } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        logger.error(e.getStackTrace());
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        logger.error("Class not found: " + renderType);
        //throw new RenderException("Render not found for: " + renderType);
    }

    return null;
}