congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AcceptedClientCommands
Code IndexAdd Tabnine to your IDE (free)

How to use
AcceptedClientCommands
in
org.kie.remote.client.jaxb

Best Java code snippets using org.kie.remote.client.jaxb.AcceptedClientCommands (Showing top 4 results out of 315)

origin: org.kie.remote/kie-remote-client

private void checkThatCommandIsAccepted(Object cmd) {
  if( ! AcceptedClientCommands.isAcceptedCommandClass(cmd.getClass()) ) {
    throw new UnsupportedOperationException(cmd.getClass().getName() + " is not an accepted command." );
  }
}
origin: org.kie.remote/kie-remote-client

protected <T> T executeCommand( Command cmd ) {
  if( AcceptedClientCommands.isSendObjectParameterCommandClass(cmd.getClass()) ) {
    List<Object> extraClassInstanceList = new ArrayList<Object>();
    preprocessParameterCommand(cmd, extraClassInstanceList);
    if( !extraClassInstanceList.isEmpty() ) {
      Set<Class<?>> extraJaxbClasses = new HashSet<Class<?>>();
      for( Object jaxbObject : extraClassInstanceList ) {
        Class<?> jaxbClass = jaxbObject.getClass();
        if( jaxbClass.isLocalClass() || jaxbClass.isAnonymousClass() ) {
          throw new SerializationException(
              "Only proper classes are allowed as parameters for the remote API: neither local nor anonymous classes are accepted: "
                  + jaxbClass.getName());
        }
        extraJaxbClasses.add(jaxbClass);
      }
      if( config.addJaxbClasses(extraJaxbClasses) ) {
        for( Class<?> extraClass : extraJaxbClasses ) {
          logger.debug( "Adding {} to the JAXBContext instance in this client instance.", extraClass.getName() );
        }
        config.initializeJaxbSerializationProvider();
      }
    }
  }
  preprocessCommand(cmd);
  if( config.isRest() ) {
    return executeRestCommand(cmd);
  } else {
    return executeJmsCommand(cmd);
  }
}
origin: org.kie.remote/kie-remote-client

@Test
public void isAcceptableCommandTest() throws Exception {
  assertTrue( "The .isAcceptedCommandClass method is not functioning correctly: generated classes",
      AcceptedClientCommands.isAcceptedCommandClass(org.kie.remote.jaxb.gen.AddTaskCommand.class));
  assertFalse( "The .isAcceptedCommandClass method is not functioning correctly: original command classes",
      AcceptedClientCommands.isAcceptedCommandClass(org.jbpm.services.task.commands.AddTaskCommand.class));
}
origin: org.kie.remote/kie-remote-client

@Test
public void reflectionMappingTest() throws Exception {
  Set<Class<?>> classes = reflections.getTypesAnnotatedWith(XmlAccessorType.class);
  assertFalse(classes.isEmpty());
  List<Class<?>> classList = new LinkedList<Class<?>>(classes);
  Collections.sort(classList, new Comparator<Class<?>>() {
    @Override
    public int compare( Class<?> o1, Class<?> o2 ) {
      return o1.getSimpleName().compareTo(o2.getSimpleName());
    }
  });
  classes = new LinkedHashSet<Class<?>>(classList);
  Map<Class, Class> kieCmdGenCmdClassMap = new LinkedHashMap<Class, Class>();
  for( Class<?> cmdClass : classes ) {
    if( ! cmdClass.getSimpleName().endsWith("Command") ) {
      continue;
    }
    if( ! AcceptedClientCommands.isAcceptedCommandClass(cmdClass) ) {
      continue;
    }
    Class genCmdClass = Class.forName("org.kie.remote.jaxb.gen." + cmdClass.getSimpleName());
    assertTrue( genCmdClass.getSimpleName() + " is not an accepted command?",
        AcceptedClientCommands.isAcceptedCommandClass(genCmdClass) );
    kieCmdGenCmdClassMap.put(cmdClass, genCmdClass);
  }
  assertFalse("No generated command classes could be found to test.",  kieCmdGenCmdClassMap.isEmpty());
  for( Entry<Class, Class> classEntry : kieCmdGenCmdClassMap.entrySet() ) {
    compareKieClassInstanceToGenClassInstance(classEntry.getKey(), classEntry.getValue());
  }
}
org.kie.remote.client.jaxbAcceptedClientCommands

Most used methods

  • isAcceptedCommandClass
  • isSendObjectParameterCommandClass

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • startActivity (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JFileChooser (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now