/** * Creates a new {@code AccessCheck}. * @param resource the config bean that is the resource to check * @param action the action on the resource * @param isFailureFatal whether a failure of this access check should force a failure of the entire authorization operation */ public AccessCheck(final ConfigBeanProxy resource, final String action, final boolean isFailureFatal) { this.resourceName = null; this.resource = resource; this.action = action; this.note = null; childType = null; parent = resource.getParent(); this.isFailureFatal = isFailureFatal; childName = null; relatedObject = null; }
ConfigBeanProxy child = param.createChild(childType); Dom dom = Dom.unwrap(child);
/** * Creates a new {@code AccessCheck}. * @param resource the config bean that is the resource to check * @param action the action on the resource * @param isFailureFatal whether a failure of this access check should force a failure of the entire authorization operation */ public AccessCheck(final ConfigBeanProxy resource, final String action, final boolean isFailureFatal) { this.resourceName = null; this.resource = resource; this.action = action; this.note = null; childType = null; parent = resource.getParent(); this.isFailureFatal = isFailureFatal; childName = null; relatedObject = null; }
@Override public Object run(ConfigBeanProxy parent) throws PropertyVetoException, TransactionFailure { U child = parent.createChild(childElement); Dom unwrappedChild = Dom.unwrap(child); unwrappedChild.addDefaultChildren(); configModularityUtils.getExtensions(parent).add(child); return child; } }, extensionOwner);
private String findConfigName(final ConfigBeanProxy child) { ConfigBeanProxy bean = child; while(bean != null && ! (bean instanceof Config)) { bean = bean.getParent(); } return bean != null ? ((Config) bean).getName() : ""; }
/** * Adds a property with the specified name and value to a writable config * object. * @param <T> the type of the config object * @param propName name of the property to add * @param propValue value of the property to add * @param owner_w the owning config object * @return the added Property object * @throws TransactionFailure * @throws PropertyVetoException */ private <T extends PropertyBag & ConfigBeanProxy> Property addProperty( final String propName, final String propValue, final T owner_w) throws TransactionFailure, PropertyVetoException { final Property p = owner_w.createChild(Property.class); p.setName(propName); p.setValue(propValue); owner_w.getProperty().add(p); return p; }
public static String getApplicationName(Resource resource){ String applicationName = null; if(resource.getParent() != null && resource.getParent().getParent() instanceof Application){ Application application = (Application)resource.getParent().getParent(); applicationName = application.getName(); } return applicationName; }
/** * Adds a property with the specified name and value to a writable config * object. * @param <T> the type of the config object * @param propName name of the property to add * @param propValue value of the property to add * @param owner_w the owning config object * @return the added Property object * @throws TransactionFailure * @throws PropertyVetoException */ private <T extends PropertyBag & ConfigBeanProxy> Property addProperty( final String propName, final String propValue, final T owner_w) throws TransactionFailure, PropertyVetoException { final Property p = owner_w.createChild(Property.class); p.setName(propName); p.setValue(propValue); owner_w.getProperty().add(p); return p; }
private <T extends ConfigBeanProxy> NotProcessed handleChangeEvent(T instance) { NotProcessed np = null; //TODO V3 handle enabled / disabled /redeploy ? debug("handling change event"); try { if (ConnectorsUtil.isValidEventType(instance)) { if(_logger.isLoggable(Level.FINEST)){ debug("redeploying resource : " + instance); } getResourceDeployer(instance).redeployResource(instance); } else if (ConnectorsUtil.isValidEventType(instance.getParent())) { if(_logger.isLoggable(Level.FINEST)){ debug("redeploying resource due to property change : " + instance.getParent()); } //Added in case of a property change //check for validity of the property's parent and redeploy getResourceDeployer(instance.getParent()).redeployResource(instance.getParent()); } } catch (Exception ex) { final String msg = ApplicationScopedResourcesManager.class.getName() + " : " + "Error while handling change Event"; _logger.severe(msg); np = new NotProcessed(msg); } return np; } }
ConfigBeanProxy child = (ConfigBeanProxy) component; try { ConfigBeanProxy cc = child.createChild(itemType); new InjectionManager().inject(cc, itemType, new InjectionResolver<Attribute>(Attribute.class) {
private boolean isCurrentInstanceMatchingTarget(PropertyChangeEvent event) { // DAS receive all the events, so we need to figure out // whether we should take action on DAS depending on the event. if(serverEnv.isInstance()) { return true; } ConfigBeanProxy proxy = (ConfigBeanProxy)(event.getSource()); while(proxy != null && !(proxy instanceof Config)) { proxy = proxy.getParent(); } if (proxy != null) { Config config = (Config)proxy; return config.isDas(); } return false; }
ConfigBeanProxy child = (ConfigBeanProxy) component; try { ConfigBeanProxy cc = child.createChild(itemType); new InjectionManager().inject(cc, itemType, new InjectionResolver<Attribute>(Attribute.class) {
public static List<NetworkListener> findNetworkListeners(VirtualServer server) { final String listeners = server.getNetworkListeners(); final String[] strings = listeners == null ? new String[0] : listeners.split(","); final NetworkConfig config = server.getParent().getParent(Config.class).getNetworkConfig(); List<NetworkListener> list = new ArrayList<NetworkListener>(); for (String name : strings) { final NetworkListener networkListener = config.getNetworkListener(name); if (networkListener != null) { list.add(networkListener); } } return list; } }
if (property == null) { ConfigBeanProxy lcProxy = transaction.enroll(lc); property = lcProxy.createChild(Property.class); property.setName(propertyName); property.setValue(String.valueOf((new Date()).getTime()));
public static List<NetworkListener> findNetworkListeners(VirtualServer server) { final String listeners = server.getNetworkListeners(); final String[] strings = listeners == null ? new String[0] : listeners.split(","); final NetworkConfig config = server.getParent().getParent(Config.class).getNetworkConfig(); List<NetworkListener> list = new ArrayList<NetworkListener>(); for (String s : strings) { final String name = s.trim(); final NetworkListener networkListener = config.getNetworkListener(name); if (networkListener != null) { list.add(networkListener); } } return list; } }
ConfigBeanProxy child = param.createChild(childType); Dom dom = Dom.unwrap(child);
@Override public boolean isValid(final Resource resource, final ConstraintValidatorContext constraintValidatorContext) { if(resource.getParent().getParent() instanceof Domain){ if(resource instanceof BindableResource){ if(((BindableResource)resource).getJndiName().contains(":")){ return false; } }else if(resource instanceof ResourcePool){ if(((ResourcePool)resource).getName().contains(":")){ return false; } } } return true; } }
ConfigBeanProxy child = param.createChild(childType); Dom dom = Dom.unwrap(child);
@Override public boolean isValid(final Resource resource, final ConstraintValidatorContext constraintValidatorContext) { if(resource.getParent().getParent() instanceof Domain){ if(resource instanceof BindableResource){ if(((BindableResource)resource).getJndiName().contains(":")){ return false; } }else if(resource instanceof ResourcePool){ if(((ResourcePool)resource).getName().contains(":")){ return false; } } } return true; } }
ConfigBeanProxy child = param.createChild(childType); Dom dom = Dom.unwrap(child);