Package org.apache.turbine.util

Examples of org.apache.turbine.util.TurbineException


        }
        catch (Exception e)
        {
            String errorMessage = "Problem updating Scheduled Job: " + je.getTask();
            log.error(errorMessage, e);
            throw new TurbineException(errorMessage, e);
        }
    }
View Full Code Here


            {
                // we should have an IP
                StringTokenizer stok = new StringTokenizer(addr, ".");
                if (stok.countTokens() != 4)
                {
                    throw new TurbineException(errorString + addr);
                }
                // this is meant to insure that id's made from ip addresses
                // will not conflict with MAC id's. I think MAC addresses
                // will never have the highest bit set.  Though this should
                // be investigated further.
                address[0] = (byte) 255;
                address[1] = (byte) 255;
                int i = 2;
                try
                {
                    while (stok.hasMoreTokens())
                    {
                        address[i++] =
                                Integer.valueOf(stok.nextToken(),
                                        16).byteValue();
                    }
                }
                catch (Exception e)
                {
                    throw new TurbineException(errorString + addr, e);
                }
            }
            else if (addr.indexOf(":") > 0)
            {
                // we should have a MAC
                StringTokenizer stok = new StringTokenizer(addr, ":");
                if (stok.countTokens() != 6)
                {
                    throw new TurbineException(errorString + addr);
                }
                int i = 0;
                try
                {
                    while (stok.hasMoreTokens())
                    {
                        address[i++] = Byte.parseByte(stok.nextToken(), 16);
                    }
                }
                catch (Exception e)
                {
                    throw new TurbineException(errorString + addr, e);
                }
            }
            else
            {
                throw new TurbineException(errorString + addr);
            }
        }
    }
View Full Code Here

        }
        catch (TorqueException e)
        {
            String errorMessage = "Error retrieving job from persistent storage.";
            log.error(errorMessage, e);
            throw new TurbineException(errorMessage, e);
        }
    }
View Full Code Here

        }
        catch (Exception e)
        {
            String errorMessage = "Problem removing Scheduled Job: " + je.getTask();
            log.error(errorMessage, e);
            throw new TurbineException(errorMessage, e);
        }
    }
View Full Code Here

        }
        catch (Exception e)
        {
            String errorMessage = "Problem updating Scheduled Job: " + je.getTask();
            log.error(errorMessage, e);
            throw new TurbineException(errorMessage, e);
        }
    }
View Full Code Here

                    String task)
            throws TurbineException
    {
        if (StringUtils.isEmpty(task))
        {
            throw new TurbineException("Error in JobEntry. " +
                    "Bad Job parameter. Task not set.");
        }

        setSecond(sec);
        setMinute(min);
View Full Code Here

                    // Not an hourly job...check if it is by the minute
                    if (getMinute() < 0)
                    {
                        // Not a by the minute job so must be by the second
                        if (getSecond() < 0)
                            throw new TurbineException("Error in JobEntry. Bad Job parameter.");

                        return SECOND;
                    }
                    else
                    {
                        // Must be a job run by the minute so we need minutes and
                        // seconds.
                        if (getMinute() < 0 || getSecond() < 0)
                            throw new TurbineException("Error in JobEntry. Bad Job parameter.");

                        return MINUTE;
                    }
                }
                else
                {
                    // Must be a daily job by hours minutes, and seconds.  In
                    // this case, we need the minute, second, and hour params.
                    if (getMinute() < 0 || getHour() < 0 || getSecond() < 0)
                        throw new TurbineException("Error in JobEntry. Bad Job parameter.");

                    return DAILY;
                }
            }
            else
            {
                // Must be a weekday job.  In this case, we need
                // minute, second, and hour params
                if (getMinute() < 0 || getHour() < 0 || getSecond() < 0)
                    throw new TurbineException("Error in JobEntry. Bad Job parameter.");

                return WEEK_DAY;
            }
        }
        else
        {
            // Must be a day of the month job.  In this case, we need
            // minute, second, and hour params
            if (getMinute() < 0 || getHour() < 0)
                throw new TurbineException("Error in JobEntry. Bad Job parameter.");

            return DAY_OF_MONTH;
        }
    }
View Full Code Here

                            ((Recyclable) instance).recycle();
                        }
                    }
                    catch (Exception x)
                    {
                        throw new TurbineException(
                                "Recycling failed for " + instance.getClass().getName(), x);
                    }
                }
            }
            return instance;
View Full Code Here

            }
            // when using Class.forName(), NoClassDefFoundErrors are likely
            // to happen (missing jar files)
            catch (Throwable t)
            {
                throw new TurbineException("Failed registering " + type
                        + " factory: " + factory, t);
            }
        }
    }
View Full Code Here

            {
                assembler = fac.getAssembler(name);
            }
            catch (Exception e)
            {
                throw new TurbineException("Failed to load an assembler for "
                                           + name + " from the "
                                           + type + " factory "
                                           + fac.getClass().getName(), e);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.TurbineException

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.