com.ny.apps.executor.OutputManager.java Source code

Java tutorial

Introduction

Here is the source code for com.ny.apps.executor.OutputManager.java

Source

/**
 * 
 * @Title OutputManager.java
 * @Description TODO
 * Copyright: Copyright (c) 2013, Smiletony and/or its affiliates. All rights reserved.
 * SMILETONY PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * 
 * @author NY
 * @date 2013-10-9 ?4:03:11
 * 
 */
package com.ny.apps.executor;

import java.util.Observable;

import org.springframework.stereotype.Service;

import com.ny.apps.exporter.ExcelExportBuilder;
import com.ny.apps.exporter.ExportBuilder;
import com.ny.apps.exporter.PdfExportBuilder;

/**
 *
 * @Description TODO
 * @author <a href="mailto:mynameisny@qq.com">Tony Joseph</a>
 * @version 1.0
 *
 */
@Service(value = "outputManager")
public class OutputManager extends Observable {
    public String export(String type) {
        String name = "tony's " + type;

        OutputManager om = new OutputManager();
        ExportBuilder pdfExportBuilder = new PdfExportBuilder();
        ExportBuilder excelExportBuilder = new ExcelExportBuilder();
        om.addObserver(pdfExportBuilder);
        om.addObserver(excelExportBuilder);
        om.setChanged();
        om.notifyObservers(name);
        return "SUCCESS";
    }
}