/*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016 - 2020 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
*/
package org.mxchange.jjobs.beans.features;
+import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
-import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.BaseJobsBean;
/**
* A feature bean
* <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Hรคder<roland@mxchange.org>
*/
@Named ("featureController")
@ApplicationScoped
-public class JobsFeatureWebApplicationBean extends BaseJobsController implements JobsFeaturesWebApplicationController {
+public class JobsFeatureWebApplicationBean extends BaseJobsBean implements JobsFeaturesWebApplicationController {
/**
* Serial number
*/
private static final long serialVersionUID = 64_237_512_690_168_674L;
+ /**
+ * Default constructor
+ */
+ public JobsFeatureWebApplicationBean () {
+ // Call super constructor
+ super();
+ }
+
+ /**
+ * Post-construction method
+ */
+ @PostConstruct
+ public void init () {
+ }
+
@Override
public boolean isFeatureEnabled (final String feature) {
// The parameter must be set
// Default is not enabled
boolean isEnabled = false;
- // Try it as an NPE may come
- try {
- // Get value from property
- String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N
+ // Get value from property
+ final String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N
+ // Is the context parameter found?
+ if (contextParameter instanceof String) {
// Is it set?
isEnabled = (Boolean.parseBoolean(contextParameter) == Boolean.TRUE);
- } catch (final NullPointerException ex) {
- // Ignored
}
- // Return value
+ // Return status
return isEnabled;
}