List of usage examples for java.util Collections synchronizedList
public static <T> List<T> synchronizedList(List<T> list)
From source file:org.openehealth.ipf.commons.ihe.core.atna.UdpServer.java
public UdpServer(int port) { this.port = port; this.packets = Collections.synchronizedList(new ArrayList<String>()); }
From source file:de.betterform.xml.xforms.model.submission.RequestHeaders.java
public synchronized List<RequestHeader> getAllHeaders() { return Collections.synchronizedList(headers); }
From source file:org.thingsplode.synapse.core.ParameterWrapper.java
public List<Parameter> getParams() { return Collections.synchronizedList(params); }
From source file:net.jodah.failsafe.internal.actions.DoThrowAction.java
DoThrowAction(ActionRegistry<R>.Expectation expectation, String name, Throwable... throwables) { super(expectation, name); Validate.notNull(throwables, "invalid null throwables"); Validate.noNullElements(throwables, "invalid null throwable"); this.arguments = Arrays.asList(throwables); this.throwables = Stream.of(throwables).collect(Collectors.toCollection(LinkedList::new)); this.current = Collections.synchronizedList(new LinkedList<>(this.throwables)); }
From source file:com.netflix.spinnaker.clouddriver.kubernetes.v2.description.manifest.KubernetesApiVersion.java
protected KubernetesApiVersion(String name) { if (values == null) { values = Collections.synchronizedList(new ArrayList<>()); }//from w w w . j a v a 2 s . c o m this.name = name; values.add(this); }
From source file:org.pentaho.aggdes.ui.model.impl.AggListImpl.java
public AggListImpl(List<UIAggregate> list) { super(); this.list = Collections.synchronizedList(list); }
From source file:org.jcf.graphicMessage.GraphicMessageImpl.java
public void addEvent(Event evt) { Assert.notNull(evt);/*from w ww .ja v a 2 s.com*/ if (events == null) setEvents(Collections.synchronizedList(new ArrayList<Event>())); events.add(evt); }
From source file:com.beyondar.example.AttachViewToGeoObjectActivity.java
/** Called when the activity is first created. */ @Override/*from ww w . j av a2 s. c om*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); showViewOn = Collections.synchronizedList(new ArrayList<BeyondarObject>()); // Hide the window title. requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.simple_camera); mBeyondarFragment = (BeyondarFragmentSupport) getSupportFragmentManager() .findFragmentById(R.id.beyondarFragment); // We create the world and fill it ... mWorld = CustomWorldHelper.generateObjects(this); // .. and send it to the fragment mBeyondarFragment.setWorld(mWorld); // We also can see the Frames per seconds mBeyondarFragment.showFPS(true); mBeyondarFragment.setOnClickBeyondarObjectListener(this); CustomBeyondarViewAdapter customBeyondarViewAdapter = new CustomBeyondarViewAdapter(this); mBeyondarFragment.setBeyondarViewAdapter(customBeyondarViewAdapter); Toast.makeText(this, "Click on any object to attach it a view", Toast.LENGTH_LONG).show(); }
From source file:com.oneplusar.example.AttachViewToGeoObjectActivity.java
/** Called when the activity is first created. */ @Override/*w ww . j a va2 s . com*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); showViewOn = Collections.synchronizedList(new ArrayList<OnePlusARObject>()); // Hide the window title. requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.simple_camera); mOnePlusARFragment = (OnePlusARFragmentSupport) getSupportFragmentManager() .findFragmentById(R.id.oneplusarFragment); // We create the world and fill it ... mWorld = CustomWorldHelper.generateObjects(this); // .. and send it to the fragment mOnePlusARFragment.setWorld(mWorld); // We also can see the Frames per seconds mOnePlusARFragment.showFPS(true); mOnePlusARFragment.setOnClickOnePlusARObjectListener(this); CustomOnePlusARViewAdapter customOnePlusARViewAdapter = new CustomOnePlusARViewAdapter(this); mOnePlusARFragment.setOnePlusARViewAdapter(customOnePlusARViewAdapter); Toast.makeText(this, "Click on any object to attach it a view", Toast.LENGTH_LONG).show(); }
From source file:org.apache.axis2.transport.nhttp.ConnectionPool.java
public static void release(NHttpClientConnection conn) { HttpHost host = (HttpHost) conn.getContext().getAttribute(HttpExecutionContext.HTTP_TARGET_HOST); String key = host.getHostName() + ":" + Integer.toString(host.getPort()); List connections = (List) connMap.get(key); if (connections == null) { connections = Collections.synchronizedList(new LinkedList()); connMap.put(key, connections);/*from w w w .j a va 2 s. c o m*/ } connections.add(conn); log.debug("Released a connection to host: " + host.getHostName() + " on port : " + host.getPort() + " to the connection pool of current size : " + connections.size()); }