Skip to content

Instantly share code, notes, and snippets.

@heiko-braun
heiko-braun / gist:818433
Created February 9, 2011 13:03
DeploymentToolPresenter
package org.jboss.as.console.client.server.deployments;
import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.NameToken;
import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
import com.gwtplatform.mvp.client.proxy.PlaceManager;
@heiko-braun
heiko-braun / Base64 sample
Created March 16, 2011 11:07
Base64 decoding error
{
"address" => [("profile" => "default")],
"operation" => "read-resource"
}
bwAAAAsACm5hbWVzcGFjZXNsAAAAAXAAA3hzaXMAKWh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1M
U2NoZW1hLWluc3RhbmNlABBzY2hlbWEtbG9jYXRpb25zbAAAABRwABR1cm46amJvc3M6ZG9tYWlu
OjEuMHMADWpib3NzXzdfMC54c2RwABx1cm46amJvc3M6ZG9tYWluOnRocmVhZHM6MS4wcwARamJv
c3MtdGhyZWFkcy54c2RwABd1cm46amJvc3M6ZG9tYWluOmVlOjEuMHMADGpib3NzLWVlLnhzZHAA
G3VybjpqYm9zczpkb21haW46bmFtaW5nOjEuMHMAEGpib3NzLW5hbWluZy54c2RwABl1cm46amJv
<datasources>
<datasource jndi-name="java:/H2DS" enabled="true" use-java-context="true" pool-name="H2DS">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<pool></pool>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
@heiko-braun
heiko-braun / gist:958913
Created May 6, 2011 13:01
xa ds properties
ModelNode operation = new ModelNode();
operation.get(OP).set(ADD);
operation.get(ADDRESS).add("profile", profile);
operation.get(ADDRESS).add("subsystem", "datasources");
operation.get(ADDRESS).add("xa-data-source", datasource.getName());
operation.get("name").set(datasource.getName());
operation.get("jndi-name").set(datasource.getJndiName());
operation.get("enabled").set(datasource.isEnabled());
@heiko-braun
heiko-braun / gist:958985
Created May 6, 2011 13:55
XA datasource creation error
Unexpected HTTP response500
Request
{
"operation" => "add",
"address" => [
("profile" => "default"),
("subsystem" => "datasources"),
("xa-data-source" => "myXA")
],
form = new Form<ServerGroupRecord>(ServerGroupRecord.class);
form.setNumColumns(2);
TextItem nameField = new TextItem("groupName", Console.CONSTANTS.common_label_name());
//jvmField = new ComboBoxItem("jvm", "Virtual Machine");
//jvmField.setValueMap(new String[] {"default"}); // TODO: https://issues.jboss.org/browse/JBAS-9156
socketBindingItem = new ComboBoxItem("socketBinding", Console.CONSTANTS.common_label_socketBinding());
socketBindingItem.setDefaultToFirstOption(true);
TextBoxItem nameField = new TextBoxItem("groupName", Console.CONSTANTS.common_label_name())
{
@Override
public boolean validate(String value) {
boolean hasValue = super.validate(value);
boolean hasWhitespace = value.contains(" ");
return hasValue && !hasWhitespace;
}
@Override
@Override
public void deleteXADataSource(String profile, XADataSource dataSource, final AsyncCallback<Boolean> callback) {
ModelNode operation = new ModelNode();
operation.get(OP).set(REMOVE);
operation.get(ADDRESS).add("profile", profile);
operation.get(ADDRESS).add("subsystem", "datasources");
operation.get(ADDRESS).add("xa-data-source", dataSource.getName());
dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
final Form<Queue> form = new Form<Queue>(Queue.class);
TextBoxItem name = new TextBoxItem("name", "Name");
TextBoxItem jndi = new TextBoxItem("jndiName", "JNDI");
CheckBoxItem durable = new CheckBoxItem("durable", "Durable?");
TextBoxItem selector = new TextBoxItem("selector", "Selector")
{
@Override
@heiko-braun
heiko-braun / gist:990961
Created May 25, 2011 13:23
auth condig standalone
<management>
<security-realms>
<security-realm name="ManagementRealm">
<authentication>
<users>
<user username="admin">
<password>password</password>
</user>
</users>
</authentication>