Search in sources :

Example 6 with TokenValueSet

use of com.sun.enterprise.admin.util.TokenValueSet in project Payara by payara.

the class RepositoryManager method createJBIInstance.

/**
 * Create JBI instance.
 */
protected void createJBIInstance(String instanceName, RepositoryConfig config) throws RepositoryException {
    final PEFileLayout layout = getFileLayout(config);
    layout.createJBIDirectories();
    final TokenValueSet tvSet = new TokenValueSet();
    final String tvDelimiter = "@";
    final String tJbiInstanceName = "JBI_INSTANCE_NAME";
    final String tJbiInstanceRoot = "JBI_INSTANCE_ROOT";
    try {
        final TokenValue tvJbiInstanceName = new TokenValue(tJbiInstanceName, instanceName, tvDelimiter);
        final TokenValue tvJbiInstanceRoot = new TokenValue(tJbiInstanceRoot, layout.getRepositoryDir().getCanonicalPath(), tvDelimiter);
        tvSet.add(tvJbiInstanceName);
        tvSet.add(tvJbiInstanceRoot);
        final File src = layout.getJbiTemplateFile();
        final File dest = layout.getJbiRegistryFile();
        generateFromTemplate(tvSet, src, dest);
        final File httpConfigSrc = layout.getHttpBcConfigTemplate();
        final File httpConfigDest = layout.getHttpBcConfigFile();
        // tokens will be added in a follow-up integration
        final TokenValueSet httpTvSet = new TokenValueSet();
        generateFromTemplate(httpTvSet, httpConfigSrc, httpConfigDest);
        createHttpBCInstallRoot(layout);
        createJavaEESEInstallRoot(layout);
        createWSDLSLInstallRoot(layout);
    } catch (Exception ioe) {
        throw new RepositoryException(_strMgr.getString("jbiRegistryFileNotCreated"), ioe);
    }
}
Also used : TokenValueSet(com.sun.enterprise.admin.util.TokenValueSet) PEFileLayout(com.sun.enterprise.admin.servermgmt.pe.PEFileLayout) ZipFile(com.sun.enterprise.util.zip.ZipFile) TokenValue(com.sun.enterprise.admin.util.TokenValue)

Aggregations

TokenValueSet (com.sun.enterprise.admin.util.TokenValueSet)6 TokenValue (com.sun.enterprise.admin.util.TokenValue)5 PEFileLayout (com.sun.enterprise.admin.servermgmt.pe.PEFileLayout)2 LineTokenReplacer (com.sun.enterprise.admin.util.LineTokenReplacer)1 ZipFile (com.sun.enterprise.util.zip.ZipFile)1 BufferedReader (java.io.BufferedReader)1 FileReader (java.io.FileReader)1