本文整理了Java中org.jvnet.hk2.config.types.Property.setName()
方法的一些代码示例,展示了Property.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.setName()
方法的具体详情如下:
包路径:org.jvnet.hk2.config.types.Property
类名称:Property
方法名:setName
[英]Sets the value of the name property.
[中]设置name属性的值。
代码示例来源:origin: org.glassfish.main.admin/config-api
private void createProperty(Property p) throws PropertyVetoException {
for (int i = 0; i < parser.getAttributeCount(); i++) {
String attr = parser.getAttributeLocalName(i);
String val = parser.getAttributeValue(i);
if (attr.equals("name")) {
p.setName(val);
}
if (attr.equals("value")) {
p.setValue(val);
}
}
}
代码示例来源:origin: org.glassfish.admin/config-api
private void createProperty(Property p) throws PropertyVetoException {
for (int i = 0; i < parser.getAttributeCount(); i++) {
String attr = parser.getAttributeLocalName(i);
String val = parser.getAttributeValue(i);
if (attr.equals("name")) {
p.setName(val);
}
if (attr.equals("value")) {
p.setValue(val);
}
}
}
代码示例来源:origin: org.glassfish.security/security
public Object run(AuthRealm updatedAuthRealm) throws PropertyVetoException, TransactionFailure {
Property prop1 = updatedAuthRealm.createChild(Property.class);
prop1.setName(PARAM_DIGEST_ALGORITHM);
prop1.setValue("MD5");
updatedAuthRealm.getProperty().add(prop1);
return null;
}
}, authRealm);
代码示例来源:origin: org.glassfish.main.security/security
public Object run(AuthRealm updatedAuthRealm) throws PropertyVetoException, TransactionFailure {
Property prop1 = updatedAuthRealm.createChild(Property.class);
prop1.setName(PARAM_DIGEST_ALGORITHM);
prop1.setValue("MD5");
updatedAuthRealm.getProperty().add(prop1);
return null;
}
}, authRealm);
代码示例来源:origin: org.glassfish.main.core/kernel
@Override
public Object run(AdminService adminService) throws PropertyVetoException, TransactionFailure {
Property newProp = adminService.createChild(Property.class);
adminService.getProperty().add(newProp);
newProp.setName(propName);
newProp.setValue(propValue);
return newProp;
}
}, adminService);
代码示例来源:origin: org.glassfish.ejb/ejb-container
public Object run(EjbTimerService ts) throws PropertyVetoException, TransactionFailure {
Property prop = ts.createChild(Property.class);
ts.getProperty().add(prop);
prop.setName(EjbContainerUtil.TIMER_SERVICE_UPGRADED);
prop.setValue("false");
ts.setMinimumDeliveryIntervalInMillis(minDelivery);
return null;
}
}, ts);
代码示例来源:origin: org.glassfish.main.security/security
private void populateAuditModuleElement(AuditModule newAuditModule)
throws PropertyVetoException, TransactionFailure {
newAuditModule.setName(auditModuleName);
newAuditModule.setClassname(className);
if (properties != null) {
for (Object propname: properties.keySet()) {
Property newprop = newAuditModule.createChild(Property.class);
newprop.setName((String) propname);
newprop.setValue(properties.getProperty((String) propname));
newAuditModule.getProperty().add(newprop);
}
}
}
}
代码示例来源:origin: org.glassfish.main.security/security
private void populateAuthRealmElement(AuthRealm newAuthRealm)
throws PropertyVetoException, TransactionFailure {
newAuthRealm.setName(authRealmName);
newAuthRealm.setClassname(className);
if (properties != null) {
for (Object propname: properties.keySet()) {
Property newprop = newAuthRealm.createChild(Property.class);
newprop.setName((String) propname);
String propValue = properties.getProperty((String) propname);
newprop.setValue(propValue);
newAuthRealm.getProperty().add(newprop);
}
}
}
代码示例来源:origin: org.glassfish.security/security
private void populateAuditModuleElement(AuditModule newAuditModule)
throws PropertyVetoException, TransactionFailure {
newAuditModule.setName(auditModuleName);
newAuditModule.setClassname(className);
if (properties != null) {
for (Object propname: properties.keySet()) {
Property newprop = newAuditModule.createChild(Property.class);
newprop.setName((String) propname);
newprop.setValue(properties.getProperty((String) propname));
newAuditModule.getProperty().add(newprop);
}
}
}
}
代码示例来源:origin: org.glassfish.main.ejb/ejb-container
public Object run(EjbTimerService ts) throws PropertyVetoException, TransactionFailure {
Property prop = ts.createChild(Property.class);
ts.getProperty().add(prop);
prop.setName(EjbContainerUtil.TIMER_SERVICE_UPGRADED);
prop.setValue("false");
ts.setMinimumDeliveryIntervalInMillis(minDelivery);
return null;
}
}, ts);
代码示例来源:origin: org.glassfish.main.admin/admin-core
/**
* 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;
}
代码示例来源:origin: org.glassfish.main.virtualization/virt-core
@Override
public Object run(VirtualMachineConfig wConfig) throws PropertyVetoException, TransactionFailure {
Property wProperty = wConfig.createChild(Property.class);
wProperty.setName(VirtualMachine.PropertyName.INSTALL_DIR.toString());
wProperty.setValue(installDir);
wConfig.getProperty().add(wProperty);
return wProperty;
}
}, vmConfig);
代码示例来源:origin: org.glassfish.security/security
private void populateAuthRealmElement(AuthRealm newAuthRealm)
throws PropertyVetoException, TransactionFailure {
newAuthRealm.setName(authRealmName);
newAuthRealm.setClassname(className);
if (properties != null) {
for (Object propname: properties.keySet()) {
Property newprop = newAuthRealm.createChild(Property.class);
newprop.setName((String) propname);
String propValue = properties.getProperty((String) propname);
if (propValue != null && propValue.contains("$")) {
propValue = RelativePathResolver.resolvePath(propValue);
}
newprop.setValue(propValue);
newAuthRealm.getProperty().add(newprop);
}
}
}
}
代码示例来源:origin: org.glassfish.main.jdbc/jdbc-admin
private JdbcResource createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
TransactionFailure {
JdbcResource jdbcResource = param.createChild(JdbcResource.class);
jdbcResource.setJndiName(jndiName);
if (description != null) {
jdbcResource.setDescription(description);
}
jdbcResource.setPoolName(poolName);
jdbcResource.setEnabled(enabled);
if (properties != null) {
for ( Map.Entry e : properties.entrySet()) {
Property prop = jdbcResource.createChild(Property.class);
prop.setName((String)e.getKey());
prop.setValue((String)e.getValue());
jdbcResource.getProperty().add(prop);
}
}
return jdbcResource;
}
代码示例来源:origin: org.glassfish.main.core/kernel
public Object run(JavaConfig param) throws PropertyVetoException, TransactionFailure {
Profiler newProfiler = param.createChild(Profiler.class);
newProfiler.setName(name);
newProfiler.setClasspath(classpath);
newProfiler.setEnabled(enabled.toString());
newProfiler.setNativeLibraryPath(nativeLibraryPath);
if (properties != null) {
for ( Map.Entry e : properties.entrySet()) {
Property prop = newProfiler.createChild(Property.class);
prop.setName((String)e.getKey());
prop.setValue((String)e.getValue());
newProfiler.getProperty().add(prop);
}
}
param.setProfiler(newProfiler);
return newProfiler;
}
}, javaConfig);
代码示例来源:origin: org.glassfish.main.jms/jms-admin
public Object run(JmsService param) throws PropertyVetoException, TransactionFailure {
JmsHost jmsHost = param.createChild(JmsHost.class); //TODO: need a way to create a JmsHost instance
jmsHost.setAdminPassword(mqpassword);
jmsHost.setAdminUserName(mquser);
jmsHost.setName(jmsHostName);
jmsHost.setHost(mqhost);
jmsHost.setPort(mqport);
if(props != null)
{
for (Map.Entry e: props.entrySet()){
Property prop = jmsHost.createChild(Property.class);
prop.setName((String)e.getKey());
prop.setValue((String)e.getValue());
jmsHost.getProperty().add(prop);
}
}
param.getJmsHost().add(jmsHost);
return jmsHost;
}
}, jmsservice);
代码示例来源:origin: org.glassfish.main.concurrent/concurrent-impl
private ContextService createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
TransactionFailure {
ContextService contextService = param.createChild(ContextService.class);
contextService.setJndiName(jndiName);
if (description != null) {
contextService.setDescription(description);
}
contextService.setContextInfoEnabled(contextInfoEnabled);
contextService.setContextInfo(contextInfo);
contextService.setEnabled(enabled);
if (properties != null) {
for ( Map.Entry e : properties.entrySet()) {
Property prop = contextService.createChild(Property.class);
prop.setName((String)e.getKey());
prop.setValue((String)e.getValue());
contextService.getProperty().add(prop);
}
}
return contextService;
}
代码示例来源:origin: org.glassfish.main.concurrent/concurrent-impl
private ManagedThreadFactory createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
TransactionFailure {
ManagedThreadFactory managedThreadFactory = param.createChild(ManagedThreadFactory.class);
managedThreadFactory.setJndiName(jndiName);
if (description != null) {
managedThreadFactory.setDescription(description);
}
managedThreadFactory.setContextInfoEnabled(contextInfoEnabled);
managedThreadFactory.setContextInfo(contextInfo);
managedThreadFactory.setThreadPriority(threadPriority);
managedThreadFactory.setEnabled(enabled);
if (properties != null) {
for ( Map.Entry e : properties.entrySet()) {
Property prop = managedThreadFactory.createChild(Property.class);
prop.setName((String)e.getKey());
prop.setValue((String)e.getValue());
managedThreadFactory.getProperty().add(prop);
}
}
return managedThreadFactory;
}
代码示例来源:origin: org.glassfish.main/paas.orchestrator
public Object run(Service serviceConfig) throws PropertyVetoException, TransactionFailure {
Property property = serviceConfig.getProperty(propName);
if (property != null) {
Transaction t = Transaction.getTransaction(serviceConfig);
Property p_w = t.enroll(property);
p_w.setValue(propValue);
} else {
Property prop = serviceConfig.createChild(Property.class);
prop.setName(propName);
prop.setValue(propValue);
serviceConfig.getProperty().add(prop);
}
return serviceConfig;
}
}, matchingService) == null) {
代码示例来源:origin: org.glassfish.main/paas.orchestrator
public Object run(Services servicesConfig) throws PropertyVetoException, TransactionFailure {
SharedService service = servicesConfig.createChild(SharedService.class);
service.setServiceName(entry.getServiceName());
service.setType(entry.getServerType());
if (entry.getParentService() != null) {
service.setParentService(entry.getParentService().getServiceName());
}
service.setState(entry.getState());
Map<String, String> properties = entry.getProperties();
if (properties != null) {
for (Map.Entry<String, String> entry : properties.entrySet()) {
Property prop = service.createChild(Property.class);
prop.setName(entry.getKey());
prop.setValue(entry.getValue());
service.getProperty().add(prop);
}
}
servicesConfig.getServices().add(service);
return service;
}
}, services);
内容来源于网络,如有侵权,请联系作者删除!