/*
 * Copyright 2013 Stefan Domnanovits
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.codebullets.sagalib.processing;

import com.codebullets.sagalib.MessageStream;
import com.codebullets.sagalib.messages.Timeout;
import com.codebullets.sagalib.storage.StateStorage;
import com.codebullets.sagalib.timeout.TimeoutExpired;
import com.codebullets.sagalib.timeout.TimeoutManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import javax.inject.Inject;
import java.lang.reflect.InvocationTargetException;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * Controls the saga message flow.
 */
public class SagaMessageStream implements MessageStream {
    private static final Logger LOG = LoggerFactory.getLogger(SagaFactory.class);

    private final SagaFactory sagaFactory;
    private final HandlerInvoker invoker;
    private final StateStorage storage;

    /**
     * Creates a new SagaMessageStream instance.
     */
    @Inject
    public SagaMessageStream(final SagaFactory sagaFactory, final HandlerInvoker invoker, final StateStorage storage, TimeoutManager timeoutManager) {
        this.sagaFactory = sagaFactory;
        this.invoker = invoker;
        this.storage = storage;

        timeoutManager.addExpiredCallback(new TimeoutExpired() {
            @Override
            public void expired(final Timeout timeout) {
                timeoutHasExpired(timeout);
            }
        });
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void add(final Object message) {
        checkNotNull(message, "Message to handle must not be null.");

        throw new NotImplementedException();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void handle(final Object message) throws InvocationTargetException, IllegalAccessException {
        checkNotNull(message, "Message to handle must not be null.");

        SagaExecutionTask executor = createExecutor(message);
        executor.handle();
    }

    /**
     * Called whenever the timeout manager reports an expired timeout.
     */
    private void timeoutHasExpired(final Timeout timeout) {
    }

    private SagaExecutionTask createExecutor(final Object message) {
        return new SagaExecutionTask(sagaFactory, invoker, storage, message);
    }
}

@@ -908,118 +908,42 @@
 ort 
-org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport sun.reflect.generics.reflectiveObjects.NotImplemented
+java.lang.reflect.InvocationTarget
 Exce
@@ -945,25 +945,24 @@
 tException;%0A
-%0A
 import javax
@@ -988,51 +988,56 @@
 ort 
-java.lang.reflect.InvocationTargetException
+org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory
 ;%0A%0Ai
@@ -1605,16 +1605,22 @@
 storage,
+ final
  Timeout
@@ -2159,32 +2159,55 @@
 new 
-NotImplementedException(
+UnsupportedOperationException(%22Not implemented%22
 );%0A 

Remove exception from sun package.