/*
 * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you 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 io.siddhi.core.stream.input.source;

import java.util.HashMap;

/**
 * SourceHandlerManager is a factory interface that would create the appropriate {@link SourceHandler}
 * for each {@link Source}.
 */
public abstract class SourceHandlerManager {

    /**
     * Saves a list of registered {@link SourceHandler} classes against the respective {@link Source} elementId.
     */
    private HashMap<String, SourceHandler> registeredSourceHandlers = new HashMap<>();

    public abstract SourceHandler generateSourceHandler(String type);

    public void registerSourceHandler(String elementId, SourceHandler sourceHandler) {
        this.registeredSourceHandlers.put(elementId, sourceHandler);
    }

    public void unregisterSourceHandler(String elementId) {
        this.registeredSourceHandlers.remove(elementId);
    }

    public HashMap<String, SourceHandler> getRegsiteredSourceHandlers() {
        return this.registeredSourceHandlers;
    }

    public void clear() {
        registeredSourceHandlers.clear();
    }
}

@@ -1141,16 +1141,492 @@
 ap%3C%3E();%0A
+    protected String sourceType;%0A%0A    /**%0A     * Generate source handler based on source type.%0A     *%0A     * @return SourceHandler%0A     */%0A    public SourceHandler generateSourceHandler(String sourceType) %7B%0A        this.sourceType = sourceType;%0A        return generateSourceHandler();%0A    %7D%0A%0A    /**%0A     * Use io.siddhi.core.stream.input.source.SourceHandlerManager#generateSourceHandler(java.lang.String) interred.%0A     *%0A     * @return SourceHandler%0A     */%0A    @Deprecated
 %0A    pub
@@ -1678,19 +1678,8 @@
 ler(
-String type
 );%0A%0A

Make the code backward compatible