Package java.security

Examples of java.security.InvalidParameterException


  private byte[] type;
 
 
  public CRCedChunk(byte[] type) throws InvalidParameterException {
    if(type.length != 4) {
      throw new InvalidParameterException("type must be of length 4, provided : " + type.length);
    }
    this.type = type;
  }
View Full Code Here


        } else if (value instanceof Number) {
            return new PUSH(cp, (Number)value);
        } else if (value instanceof String) {
            return new PUSH(cp, (String)value);
        } else {
            throw new InvalidParameterException
                ("Internal code generation error!");
        }
    }
View Full Code Here

                  dateFormatter = new SimpleDateFormat(dateFormat);
               lReturn = dateFormatter.parse( pStartDate );
            }
            catch( Exception e2 ) {
               log.error( "Could not parse given date string: " + pStartDate, e2 );
               throw new InvalidParameterException( "Schedulable Date is not of correct format" );
            }
         }
      }
      log.debug( "Initial Start Date is set to: " + lReturn );
     
View Full Code Here

                  dateFormatter = new SimpleDateFormat(dateFormat);
               lReturn = dateFormatter.parse( pStartDate );
            }
            catch( Exception e2 ) {
               log.error( "Could not parse given date string: " + pStartDate, e2 );
               throw new InvalidParameterException( "Schedulable Date is not of correct format" );
            }
         }
      }
      log.debug( "Initial Start Date is set to: " + lReturn );
     
View Full Code Here

   private void checkMBean() {
    if (mSchedulableMBean == null)
    {
     log.debug("Schedulable MBean Object Name is not set");
     throw new InvalidParameterException(
      "Schedulable MBean must be set"
     );
    }
    if (mSchedulableMBeanMethodName == null)
    {
View Full Code Here

   }

   private void createSchedulable() {
    if (mSchedulableClass == null)
    {
     throw new InvalidParameterException("Schedulable Class not set");
    }
    if (mSchedulableArgumentList.length != mSchedulableArgumentTypeList.length)
    {
     throw new InvalidParameterException(
      "Schedulable Class Arguments and Types do not match in length"
     );
    }
    // Create all the Objects for the Constructor to be called
    Object[] lArgumentList = new Object[mSchedulableArgumentTypeList.length];
    try
    {
     for (int i = 0; i < mSchedulableArgumentTypeList.length; i++)
     {
      Class lClass = mSchedulableArgumentTypeList[i];
      if (lClass == Boolean.TYPE)
      {
         lArgumentList[i] = new Boolean(mSchedulableArgumentList[i]);
      }
      else if (lClass == Integer.TYPE)
      {
         lArgumentList[i] = new Integer(mSchedulableArgumentList[i]);
      }
      else if (lClass == Long.TYPE)
      {
         lArgumentList[i] = new Long(mSchedulableArgumentList[i]);
      }
      else if (lClass == Short.TYPE)
      {
         lArgumentList[i] = new Short(mSchedulableArgumentList[i]);
      }
      else if (lClass == Float.TYPE)
      {
         lArgumentList[i] = new Float(mSchedulableArgumentList[i]);
      }
      else if (lClass == Double.TYPE)
      {
         lArgumentList[i] = new Double(mSchedulableArgumentList[i]);
      }
      else if (lClass == Byte.TYPE)
      {
         lArgumentList[i] = new Byte(mSchedulableArgumentList[i]);
      }
      else if (lClass == Character.TYPE)
      {
         lArgumentList[i] = new Character(mSchedulableArgumentList[i].charAt(0));
      }
      else
      {
         Constructor lConstructor = lClass.getConstructor(new Class[]{String.class});
         lArgumentList[i] = lConstructor.newInstance(new Object[]{mSchedulableArgumentList[i]});
      }
     }
    }
    catch (Exception e)
    {
     log.error("Could not load or create constructor argument", e);
     throw new InvalidParameterException("Could not load or create a constructor argument");
    }
    try
    {
     // Check if constructor is found
     Constructor lSchedulableConstructor = mSchedulableClass.getConstructor(mSchedulableArgumentTypeList);
     // Create an instance of it
     mSchedulable = (Schedulable) lSchedulableConstructor.newInstance(lArgumentList);
    }
    catch (Exception e)
    {
     log.error("Could not find the constructor or create Schedulable instance", e);
     throw new InvalidParameterException("Could not find the constructor or create the Schedulable Instance");
    }
   }
View Full Code Here

   public void setSchedulableClass(String pSchedulableClass)
      throws InvalidParameterException
   {
      if (pSchedulableClass == null || pSchedulableClass.equals(""))
      {
         throw new InvalidParameterException("Schedulable Class cannot be empty or undefined");
      }
      try
      {
         // Try to load the Schedulable Class
         ClassLoader loader = TCLActions.getContextClassLoader();
         mSchedulableClass = loader.loadClass(pSchedulableClass);
         // Check if instance of Schedulable
         if (!isSchedulable(mSchedulableClass))
         {
            String msg = "Given class " + pSchedulableClass + " is not instance of Schedulable";
            StringBuffer info = new StringBuffer(msg);
            info.append("\nThe SchedulableClass info:");
            Classes.displayClassInfo(mSchedulableClass, info);
            info.append("\nSchedulable.class info:");
            Classes.displayClassInfo(Schedulable.class, info);
            log.debug(info.toString());
            throw new InvalidParameterException(msg);
         }
      }
      catch (ClassNotFoundException e)
      {
         log.info("Failed to find: "+pSchedulableClass, e);
         throw new InvalidParameterException(
            "Given class " + pSchedulableClass + " is not  not found"
         );
      }
      mIsRestartPending = true;
      mUseMBean = false;
View Full Code Here

                  ClassLoader loader = TCLActions.getContextClassLoader();
                  lClass = loader.loadClass(lToken);
               }
               catch (ClassNotFoundException cnfe)
               {
                  throw new InvalidParameterException(
                     "The argument type: " + lToken + " is not a valid class or could not be found"
                  );
               }
            }
            lList.add(lClass);
View Full Code Here

   public void setSchedulableMBean(String pSchedulableMBean)
      throws InvalidParameterException
   {
      if (pSchedulableMBean == null)
      {
         throw new InvalidParameterException("Schedulable MBean must be specified");
      }
      try
      {
         mSchedulableMBean = new ObjectName(pSchedulableMBean);
         mUseMBean = true;
      }
      catch (MalformedObjectNameException e)
      {
         throw new InvalidParameterException("Schedulable MBean name invalid " + pSchedulableMBean);
      }
   }
View Full Code Here

      if (lIndex >= 0)
      {
         int lIndex2 = pSchedulableMBeanMethod.indexOf(')');
         if (lIndex2 < lIndex)
         {
            throw new InvalidParameterException("Schedulable MBean Method: closing bracket must be after opening bracket");
         }
         if (lIndex2 < pSchedulableMBeanMethod.length() - 1)
         {
            String lRest = pSchedulableMBeanMethod.substring(lIndex2 + 1).trim();
            if (lRest.length() > 0)
            {
               throw new InvalidParameterException("Schedulable MBean Method: nothing should be after closing bracket");
            }
         }
         String lArguments = pSchedulableMBeanMethod.substring(lIndex + 1, lIndex2).trim();
         if (lArguments.equals(""))
         {
View Full Code Here

TOP

Related Classes of java.security.InvalidParameterException

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.