org.apache.tomcat.websocket.TransformationFactory Java Examples
The following examples show how to use
org.apache.tomcat.websocket.TransformationFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UpgradeUtil.java From Tomcat8-Source-Read with MIT License | 5 votes |
private static List<Transformation> createTransformations( List<Extension> negotiatedExtensions) { TransformationFactory factory = TransformationFactory.getInstance(); LinkedHashMap<String,List<List<Extension.Parameter>>> extensionPreferences = new LinkedHashMap<>(); // Result will likely be smaller than this List<Transformation> result = new ArrayList<>(negotiatedExtensions.size()); for (Extension extension : negotiatedExtensions) { List<List<Extension.Parameter>> preferences = extensionPreferences.get(extension.getName()); if (preferences == null) { preferences = new ArrayList<>(); extensionPreferences.put(extension.getName(), preferences); } preferences.add(extension.getParameters()); } for (Map.Entry<String,List<List<Extension.Parameter>>> entry : extensionPreferences.entrySet()) { Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true); if (transformation != null) { result.add(transformation); } } return result; }
Example #2
Source File: UpgradeUtil.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
private static List<Transformation> createTransformations( List<Extension> negotiatedExtensions) { TransformationFactory factory = TransformationFactory.getInstance(); LinkedHashMap<String,List<List<Extension.Parameter>>> extensionPreferences = new LinkedHashMap<String,List<List<Extension.Parameter>>>(); // Result will likely be smaller than this List<Transformation> result = new ArrayList<Transformation>(negotiatedExtensions.size()); for (Extension extension : negotiatedExtensions) { List<List<Extension.Parameter>> preferences = extensionPreferences.get(extension.getName()); if (preferences == null) { preferences = new ArrayList<List<Extension.Parameter>>(); extensionPreferences.put(extension.getName(), preferences); } preferences.add(extension.getParameters()); } for (Map.Entry<String,List<List<Extension.Parameter>>> entry : extensionPreferences.entrySet()) { Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true); if (transformation != null) { result.add(transformation); } } return result; }
Example #3
Source File: UpgradeUtil.java From tomcatsrc with Apache License 2.0 | 5 votes |
private static List<Transformation> createTransformations( List<Extension> negotiatedExtensions) { TransformationFactory factory = TransformationFactory.getInstance(); LinkedHashMap<String,List<List<Extension.Parameter>>> extensionPreferences = new LinkedHashMap<String,List<List<Extension.Parameter>>>(); // Result will likely be smaller than this List<Transformation> result = new ArrayList<Transformation>(negotiatedExtensions.size()); for (Extension extension : negotiatedExtensions) { List<List<Extension.Parameter>> preferences = extensionPreferences.get(extension.getName()); if (preferences == null) { preferences = new ArrayList<List<Extension.Parameter>>(); extensionPreferences.put(extension.getName(), preferences); } preferences.add(extension.getParameters()); } for (Map.Entry<String,List<List<Extension.Parameter>>> entry : extensionPreferences.entrySet()) { Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true); if (transformation != null) { result.add(transformation); } } return result; }