Example usage for java.lang Package getImplementationTitle

List of usage examples for java.lang Package getImplementationTitle

Introduction

In this page you can find the example usage for java.lang Package getImplementationTitle.

Prototype

public String getImplementationTitle() 

Source Link

Document

Return the title of this package.

Usage

From source file:de.thetaphi.forbiddenapis.cli.CliMain.java

private void printVersion() {
    final Package pkg = this.getClass().getPackage();
    LOG.info(String.format(Locale.ENGLISH, "%s %s", pkg.getImplementationTitle(),
            pkg.getImplementationVersion()));
}

From source file:adalid.util.info.JavaInfo.java

public void printPackageDetails(String name) {
    Package pack = Package.getPackage(name);
    out.println("Package " + name + ": " + pack);
    if (pack != null) {
        out.println("\t" + Attributes.Name.IMPLEMENTATION_TITLE + ":   " + pack.getImplementationTitle());
        out.println("\t" + Attributes.Name.IMPLEMENTATION_VENDOR + ":  " + pack.getImplementationVendor());
        out.println("\t" + Attributes.Name.IMPLEMENTATION_VERSION + ": " + pack.getImplementationVersion());
        out.println("\t" + Attributes.Name.SPECIFICATION_TITLE + ":    " + pack.getSpecificationTitle());
        out.println("\t" + Attributes.Name.SPECIFICATION_VENDOR + ":   " + pack.getSpecificationVendor());
        out.println("\t" + Attributes.Name.SPECIFICATION_VERSION + ":  " + pack.getSpecificationVersion());
        out.println();//from ww w.  j  av  a 2  s  . c  o  m
    }
}

From source file:de.thetaphi.forbiddenapis.CliMain.java

private void printVersion() {
    final Package pkg = this.getClass().getPackage();
    logInfo(String.format(Locale.ENGLISH, "%s %s", pkg.getImplementationTitle(),
            pkg.getImplementationVersion()));
}

From source file:com.digium.respoke.Respoke.java

private String getSDKHeader() {
    Package pkg = getClass().getPackage();
    String javaVersion = String.format("Java/%s", System.getProperty("java.version"));
    String osVersion = String.format("%s %s", System.getProperty("os.name"), System.getProperty("os.version"));
    String packageVersion = String.format("%s/%s", pkg.getImplementationTitle(),
            pkg.getImplementationVersion());

    return String.format("%s (%s) %s", packageVersion, osVersion, javaVersion);
}

From source file:com.quinsoft.zeidon.standardoe.JavaObjectEngine.java

/**
 * Instantiates a Java Object Engine using the options specified.
 *
 * @param options//from   ww w  . j a  va  2 s .  co  m
 */
public JavaObjectEngine(JavaOeConfiguration options) {
    ZeidonLogger logger = options.getZeidonLogger();
    zeidonHomeDir = options.getHomeDirectory();
    domainClassLoader = options.getDomainClassLoader();
    threadPool = options.getActivateThreadPool();
    zeidonPreferencesFactory = options.getPreferencesFactory();
    uuidGenerator = options.getUuidGenerator();
    oeListener = options.getObjectEngineListener();

    Package _package = this.getClass().getPackage();
    String version = _package.getImplementationVersion();
    String builtDate = _package.getImplementationTitle();
    logger.info("Zeidon JOE Version: %s  Build Date: %s", version, builtDate);
    logger.info("classpath = %s", getClassPath(logger));
    logger.info("User.dir = %s", System.getProperty("user.dir"));

    // Generate a UUID as a task ID.
    id = uuidGenerator.generate().toString();

    // Create HashMap with weak values so that tasks will be automatically GC'd when they are no longer being used.
    taskList = new MapMaker().concurrencyLevel(10).weakValues().makeMap();
    persistentTaskList = options.getPersistentTaskCacheMap();

    applicationList = new ApplicationList(zeidonHomeDir, logger);
    systemTask = createTask(ObjectEngine.ZEIDON_SYSTEM_APP_NAME, true, ObjectEngine.ZEIDON_SYSTEM_APP_NAME);
    oeListener.setObjectEngine(this);

    // Check to see if we should start the browser.
    String startBrowser = JoeUtils.getEnvProperty("zeidon.start.browser");
    if (StringUtils.isBlank(startBrowser))
        startBrowser = systemTask.readZeidonConfig("Browser", "Start", "");
    else
        // Log a message in case the ENVVAR overrides the value from zeidon.ini
        logger.info("startBrowser indicator is from zeidon.start.browser: %s", startBrowser);

    if (!StringUtils.isBlank(startBrowser) && startBrowser.toUpperCase().startsWith("Y"))
        startBrowser();

    assert logAssertMessage(systemTask); // Write a message to the log if assertions are on.
}

From source file:com.norconex.collector.core.AbstractCollector.java

private void printReleaseVersion(String moduleName, Package p) {
    String version = p.getImplementationVersion();
    if (StringUtils.isBlank(version)) {
        // No version is likely due to using an unpacked or modified 
        // jar, or the jar not being packaged with version 
        // information.
        LOG.info("Version: \"" + moduleName + "\" version is undefined.");
        return;/*from   w  ww .ja v a2 s  .co m*/
    }
    LOG.info("Version: " + p.getImplementationTitle() + " " + p.getImplementationVersion() + " ("
            + p.getImplementationVendor() + ")");
}

From source file:net.chaosserver.timelord.swingui.Timelord.java

/**
 * Shows the about dialog that tells about the application.
 *///from w ww.java 2  s  .c om
public void showAboutDialog() {
    Package packageInfo = Package.getPackage("net.chaosserver.timelord.swingui");

    if (log.isTraceEnabled()) {
        if (packageInfo != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(packageInfo.getClass().getName());
            sb.append(" [name=");
            sb.append(packageInfo.getName());
            sb.append(", specificationTitle=");
            sb.append(packageInfo.getSpecificationTitle());
            sb.append(", specificationVersion=");
            sb.append(packageInfo.getSpecificationVersion());
            sb.append(", specificationVendor=");
            sb.append(packageInfo.getSpecificationVendor());
            sb.append(", implementationTitle=");
            sb.append(packageInfo.getImplementationTitle());
            sb.append(", implementationVersion=");
            sb.append(packageInfo.getImplementationVersion());
            sb.append(", implementationVendor=");
            sb.append(packageInfo.getImplementationVendor());
            sb.append("]");
            log.trace(sb.toString());
        }
    }

    StringBuffer sb = new StringBuffer();
    sb.append("Timelord");

    if ((packageInfo != null) && (packageInfo.getImplementationVersion() != null)) {
        sb.append(" [");
        sb.append(packageInfo.getImplementationVersion());
        sb.append("]");
    } else {
        Properties appProperties = getAppProperties();
        if (appProperties != null) {
            sb.append(" ");
            sb.append(appProperties.getProperty("implementation.version", "[Unknown Version]"));
        } else {
            sb.append(" [Unknown Version]");
        }
    }

    sb.append("\n");
    sb.append(resourceBundle.getString(RROOT + ".about"));

    JOptionPane.showMessageDialog(applicationFrame, sb.toString(), "About Timelord",
            JOptionPane.INFORMATION_MESSAGE, applicationIcon);
}