001    /*
002     * Copyright (c) 2009 The openGion Project.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013     * either express or implied. See the License for the specific language
014     * governing permissions and limitations under the License.
015     */
016    package org.opengion.fukurou.util;
017    
018    import java.io.File;
019    
020    /**
021     * HybsLoaderを生成するためã?、設定情報を管ç�?�™るためã?クラスですã?
022     *
023     * @og.rev 5.1.1.0 (2009/12/01) 新規作æ?
024     * @og.group 業務ロジãƒ?‚¯
025     *
026     * @version 5.0
027     * @author Hiroki Nakamura
028     * @since JDK1.6,
029     */
030    public class HybsLoaderConfig {
031            private final String srcDir;
032            private final String classDir;
033    //      private final boolean isAutoCompile;
034    //      private final boolean isHotDeploy;
035            private final boolean useAutoCompile;           // 5.1.8.0 (2010/07/01) メソãƒ?ƒ‰名と同じフィールド名なので、変更
036            private final boolean useHotDeploy;                     // 5.1.8.0 (2010/07/01) メソãƒ?ƒ‰名と同じフィールド名なので、変更
037            private final String classPath;
038    
039            /**
040             * ソースãƒ?‚£レクトリとクラスãƒ?‚£レクトリのみを指定し、HybsLoaderの設定情報を構築しますã?
041             * こã?場合ã?AutoCompile機è?、HotDeploy機è?は無効になりますã?
042             *
043             * @param sDir ソースãƒ?‚£レクトリ
044             * @param cDir クラスãƒ?‚£レクトリ
045             */
046    //      public HybsLoaderConfig( final String sDir, final String cDir, final boolean isDebug ) {
047            public HybsLoaderConfig( final String sDir, final String cDir ) {
048                    this( sDir, cDir, false, false, null );
049            }
050    
051            /**
052             * HybsLoaderの設定情報を構築しますã?
053             *
054             * @param sDir ソースãƒ?‚£レクトリ
055             * @param cDir クラスãƒ?‚£レクトリ
056             * @param acom AutoCompile機è?を有効にするã�?
057             * @param hdep HotDeploy機è?を有効にするã�?
058             * @param clsPath コンパイル時ã?クラスパス
059             */
060            public HybsLoaderConfig( final String sDir, final String cDir
061                            ,final boolean acom, final boolean hdep, final String clsPath ) {
062                    srcDir = sDir.charAt( sDir.length() -1 ) == File.separatorChar ? sDir : sDir + File.separator;
063                    classDir = cDir.charAt( cDir.length() -1 ) == File.separatorChar ? cDir : cDir + File.separator;
064    
065                    useAutoCompile = acom;
066                    useHotDeploy = hdep;
067                    classPath  = clsPath;
068            }
069    
070            /**
071             * ソースãƒ?‚£レクトリを取得しますã?
072             *
073             * @return ソースãƒ?‚£レクトリ
074             */
075            public String getSrcDir() {
076                    return srcDir;
077            }
078    
079            /**
080             * クラスãƒ?‚£レクトリを取得しますã?
081             *
082             * @return クラスãƒ?‚£レクトリ
083             */
084            public String getClassDir() {
085                    return classDir;
086            }
087    
088            /**
089             * AutoCompileが有効化どã�?�‹を取得しますã?
090             *
091             * @return AutoCompileが有効ã�?
092             */
093            public boolean isAutoCompile() {
094                    return useAutoCompile;
095            }
096    
097            /**
098             * HotDeployが有効化どã�?�‹を取得しますã?
099             *
100             * @return HotDeployが有効ã�?
101             */
102            public boolean isHotDeploy() {
103                    return useHotDeploy;
104            }
105    
106            /**
107             * コンパイルのためのクラスパスを返しますã?
108             * コンストラクタでè¤?•°のクラスパスが指定された場合ã?
109             * ここで返されるクラスパスはã€?;'区åˆ?‚Šのクラスパスになりますã?
110             *
111             * @return クラスパス
112             */
113            public String getClassPath() {
114                    return classPath;
115            }
116    }