Package org.drools.common

Examples of org.drools.common.DisconnectedFactHandle


            }
        }

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext context) {
            FactHandle factHandle = new DisconnectedFactHandle( reader.getAttribute( "factHandle" ) );
            String identifierOut = reader.getAttribute( "out-identifier" );

            GetObjectCommand cmd = new GetObjectCommand( factHandle );
            if ( identifierOut != null ) {
                cmd.setOutIdentifier( identifierOut );
View Full Code Here


                    reader.moveUp();
                    reader.moveUp();
                } else if ( reader.getNodeName().equals( "fact-handle" ) ) {
                    String identifier = reader.getAttribute( "identifier" );
                    facts.put( identifier,
                               new DisconnectedFactHandle( reader.getAttribute( "externalForm" ) ) );
                } else if ( reader.getNodeName().equals( "fact-handles" ) ) {
                    String identifier = reader.getAttribute( "identifier" );
                    List<FactHandle> list = new ArrayList();
                    while ( reader.hasMoreChildren() ) {
                        reader.moveDown();
                        list.add( new DisconnectedFactHandle( reader.getAttribute( "externalForm" ) ) );
                        reader.moveUp();
                    }
                    facts.put( identifier,
                               list );
                } else {
View Full Code Here

                                              context,
                                              null );
                    reader.moveUp();
                   
                    reader.moveDown();
                    FactHandle handle = new DisconnectedFactHandle( reader.getAttribute( "externalForm" ) );
                    reader.moveUp();                   
                 
                    objects.add( object );
                    handles.addhandle  );
                }
View Full Code Here

        Class<? extends Object> vClass = obj.getClass();
       
        if ( obj instanceof NativeQueryResults ) {
            obj = new FlatQueryResults( ((NativeQueryResults )obj).getResults() );
        } else if (obj instanceof FactHandle && !(obj instanceof DisconnectedFactHandle)) {
            obj = new DisconnectedFactHandle(((FactHandle) obj).toExternalForm());
          } else if (List.class.isAssignableFrom(vClass) && !JaxbListWrapper.class.equals(vClass)) {   
                  obj = new JaxbListWrapper( ((List<?>) obj).toArray( new Object[((List<?>) obj).size()]) );;
          }
      ret.add(new JaxbPair(entry.getKey(), obj));
    }
View Full Code Here

            }
        }

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext context) {
            FactHandle factHandle = new DisconnectedFactHandle( reader.getAttribute( "fact-handle" ) );

            List<Setter> setters = new ArrayList();
            while ( reader.hasMoreChildren() ) {
                reader.moveDown();
                Setter setter = CommandFactory.newSetter( reader.getAttribute( "accessor" ),
View Full Code Here

                                 cmd.getFactHandle().toExternalForm() );
        }

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext context) {
            FactHandle factHandle = new DisconnectedFactHandle( reader.getAttribute( "fact-handle" ) );

            Command cmd = CommandFactory.newRetract( factHandle );

            return cmd;
        }
View Full Code Here

            }
        }

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext context) {
            FactHandle factHandle = new DisconnectedFactHandle( reader.getAttribute( "fact-handle" ) );
            String identifierOut = reader.getAttribute( "out-identifier" );

            GetObjectCommand cmd = new GetObjectCommand( factHandle );
            if ( identifierOut != null ) {
                cmd.setOutIdentifier( identifierOut );
View Full Code Here

                    reader.moveUp();
                    reader.moveUp();
                } else if ( reader.getNodeName().equals( "fact-handle" ) ) {
                    String identifier = reader.getAttribute( "identifier" );
                    facts.put( identifier,
                               new DisconnectedFactHandle( reader.getAttribute( "external-form" ) ) );
                } else if ( reader.getNodeName().equals( "fact-handles" ) ) {
                    String identifier = reader.getAttribute( "identifier" );
                    List<FactHandle> list = new ArrayList();
                    while ( reader.hasMoreChildren() ) {
                        reader.moveDown();
                        list.add( new DisconnectedFactHandle( reader.getAttribute( "external-form" ) ) );
                        reader.moveUp();
                    }
                    facts.put( identifier,
                               list );
                } else {
View Full Code Here

                                              context,
                                              null );
                    reader.moveUp();

                    reader.moveDown();
                    FactHandle handle = new DisconnectedFactHandle( reader.getAttribute( "external-form" ) );
                    reader.moveUp();

                    objects.add( object );
                    handles.add( handle );
                }
View Full Code Here

        LeftTuple entry = tuple;

        // Add all the FactHandles except the root DroolQuery object
        while ( entry.getIndex() > 0 ) {
            InternalFactHandle handle = entry.getLastHandle();
            handles[entry.getIndex()] = new DisconnectedFactHandle( handle.getId(),
                                                                    handle.getIdentityHashCode(),
                                                                    handle.getObjectHashCode(),
                                                                    handle.getRecency(),
                                                                    handle.getObject() );
            entry = entry.getParent();
        }

        // Get the Query object
        InternalFactHandle handle = entry.getLastHandle();
        DroolsQuery query = (DroolsQuery) handle.getObject();

        // Copy of it's arguments for unification variables.
        Object[] args = query.getElements();
        Object[] newArgs = new Object[args.length];
        for ( int i = 0, length = args.length; i < length; i++ ) {
            if ( args[i] instanceof Variable ) {
                newArgs[i] = ((Variable) args[i]).getValue();
            } else {
                newArgs[i] = args[i];
            }
        }
        handles[entry.getIndex()] = new DisconnectedFactHandle( handle.getId(),
                                                                handle.getIdentityHashCode(),
                                                                handle.getObjectHashCode(),
                                                                handle.getRecency(),
                                                                new ArrayElements( newArgs ) );
View Full Code Here

TOP

Related Classes of org.drools.common.DisconnectedFactHandle

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.