src/main/java/org/iota/ict/ixi/GraphModule.java
@Override
    public void run() {

        new Thread(() -> {
            try {

                LinkedList<String> headsToProcess = new LinkedList<>();

                while(isRunning()){

                    GossipEvent effect = gossipPreprocessor.takeEffect();
                    gossipPreprocessor.passOn(effect);

                    if(effect.isOwnTransaction())
                        continue;

                    Transaction transaction = effect.getTransaction();

                    if(transaction.isBundleHead)
                        headsToProcess.add(transaction.hash);

                    for(String x: new ArrayList<>(headsToProcess)) {

                        Transaction head = ixi.findTransactionByHash(x);
                        List<Transaction> bundle = completeBundle(head);
                        if(bundle.size() == 0)
                            continue;
                        deserializeAndStore(bundle);
                        headsToProcess.remove(x);

                    }

                }
            } catch (InterruptedException e){
                e.printStackTrace();
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processCreateVertexRequest(createVertex.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processStartVertexRequest(startVertex.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processAddEdgeRequest(addEdge.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processAddEdgesRequest(addEdges.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetData(getData.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetEdges(getEdges.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetNextEdge(getNextEdge.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetReferencingVertices(getReferencingVertices.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processIsReferencing(isReferencing.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processSerializeAndSubmit(serializeAndSubmit.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processSerializeAndSubmitToCustomTips(serializeAndSubmitToCustomTips.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetSerializedTail(getSerializedTail.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();

        System.out.println("Graph.ixi successfully started!");

    }
/**
     * This method will be executed once graph.ixi got injected into Ict.
     */
This method will be executed once graph.ixi got injected into Ict.
This method will be executed once graph . ixi got injected into Ict .
@Override
    public void run() {
        new Thread(() -> {
            try {
                LinkedList<String> headsToProcess = new LinkedList<>();
                while(isRunning()){
                    GossipEvent effect = gossipPreprocessor.takeEffect();
                    gossipPreprocessor.passOn(effect);
                    if(effect.isOwnTransaction())
                        continue;
                    Transaction transaction = effect.getTransaction();
                    if(transaction.isBundleHead)
                        headsToProcess.add(transaction.hash);
                    for(String x: new ArrayList<>(headsToProcess)) {
                        Transaction head = ixi.findTransactionByHash(x);
                        List<Transaction> bundle = completeBundle(head);
                        if(bundle.size() == 0)
                            continue;
                        deserializeAndStore(bundle);
                        headsToProcess.remove(x);
                    }
                }
            } catch (InterruptedException e){
                e.printStackTrace();
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processCreateVertexRequest(createVertex.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processStartVertexRequest(startVertex.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processAddEdgeRequest(addEdge.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processAddEdgesRequest(addEdges.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetData(getData.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetEdges(getEdges.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetNextEdge(getNextEdge.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetReferencingVertices(getReferencingVertices.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processIsReferencing(isReferencing.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processSerializeAndSubmit(serializeAndSubmit.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processSerializeAndSubmitToCustomTips(serializeAndSubmitToCustomTips.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        new Thread(() -> {
            while (isRunning()) {
                try {
                    processGetSerializedTail(getSerializedTail.requestQueue.take());
                } catch (InterruptedException e) {
                    if(isRunning()) throw new RuntimeException(e);
                }
            }
        }).start();
        System.out.println("Graph.ixi successfully started!");
    }
@ Override public void run ( ) { new Thread ( ( ) -> { try { LinkedList < String > headsToProcess = new LinkedList < > ( ) ; while ( isRunning ( ) ) { GossipEvent effect = gossipPreprocessor . takeEffect ( ) ; gossipPreprocessor . passOn ( effect ) ; if ( effect . isOwnTransaction ( ) ) continue ; Transaction transaction = effect . getTransaction ( ) ; if ( transaction . isBundleHead ) headsToProcess . add ( transaction . hash ) ; for ( String x : new ArrayList < > ( headsToProcess ) ) { Transaction head = ixi . findTransactionByHash ( x ) ; List < Transaction > bundle = completeBundle ( head ) ; if ( bundle . size ( ) == 0 ) continue ; deserializeAndStore ( bundle ) ; headsToProcess . remove ( x ) ; } } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processCreateVertexRequest ( createVertex . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processStartVertexRequest ( startVertex . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processAddEdgeRequest ( addEdge . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processAddEdgesRequest ( addEdges . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processGetData ( getData . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processGetEdges ( getEdges . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processGetNextEdge ( getNextEdge . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processGetReferencingVertices ( getReferencingVertices . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processIsReferencing ( isReferencing . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processSerializeAndSubmit ( serializeAndSubmit . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processSerializeAndSubmitToCustomTips ( serializeAndSubmitToCustomTips . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; new Thread ( ( ) -> { while ( isRunning ( ) ) { try { processGetSerializedTail ( getSerializedTail . requestQueue . take ( ) ) ; } catch ( InterruptedException e ) { if ( isRunning ( ) ) throw new RuntimeException ( e ) ; } } } ) . start ( ) ; System . out . println ( "Graph.ixi successfully started!" ) ; }
This method will be executed once graph.ixi got injected into Ict.
This method will be executed once graph . ixi got injected into Ict .